You are on page 1of 32

Inferential Statistics VI:

Paired t-Test and


Chi-square Tests

Mr. Shital Bhandary


Assistant Professor
DCHS, PAHS-SOM
t-test: Paired Sample

 When we have to test the significance to two


sample means from a dependent sample(s),
then we use this test.
 Here, we usually try to relate two samples
having one-to-one relationship with each and
every item.
 In other words, it is used to test the outcome
of an small experiment having before and
after results on a particular subject.
Example
 KUMS Medical Education Department organized
a 3-day Micro-Teaching program for its faculty
members from KUMS, DH and B&B. In that
workshop, pre-test and post-test scores were
recorded by using a pre-assigned questionnaire.
 Later, the KU account section asked to prove its
effectiveness for the payment of the seminar
expenses.
 Now, find if the micro-teaching training program
was really effective using the given data so that
the payment can be done to the respective
parties.
Data:

ID of Participant Pre-test score Post-test score


KUMS 1 17 17
DH 1 12 15
B&B1 15 15
DH 2 16 18
B&B2 13 16
KUMS 2 15 19
KUMS 3 12 18
B&B3 14 15
DH 3 11 13
KUMS 4 18 19
Solution:
ID Pre-TS Post-TS Difference Deviation Dev Sq.
X1 X2 d=X2–X1 d’= d – d d’2
KUMS 1 17 17 0 -1.9 3.61
DH 1 12 15 3 1.1 1.21
B&B1 15 15 0 -1.9 3.61
B&B2 16 18 2 0.1 0.01
DH 2 13 16 3 1.1 1.21
KUMS 2 15 19 4 2.1 4.41
KUMS 3 12 18 6 4.1 16.81
DH 3 14 15 1 -0.9 0.81
B&B3 11 10 -1 -2.9 8.41
KUMS 4 18 19 1 -0.9 0.81
Total Σd = 19 d = 1.9 Σd’2 = 40.9
Solution:
 H0: d = 0, i.e. there is no difference between
pre-test and post-test scores.
(The training has not been effective)
 H1: d > 0, i.e. there is a positive difference
between pre-test and post-test scores.
(The training has positive impact)
 From table, s.d. (d) = 2.13, d = 1.9
 S.E. (d) = 0.6741 t-statistic = d/S.E. (d)
 t-statistic = 2.8185 t-tabulated = 1.833
 Since tcal > ttab, we reject H0. Which means that
the micro-teaching program was a success.
 Thus, payment should be made.
Exercise 25
 Oral Contraceptive (OC) users are known to
weigh less than non-OC users.
 Since low weight tends to be associated with low
blood pressure, OC user’s blood pressure levels
as a group would appear lower than non-OC
users.
 To test this hypothesis twelve women are
followed with their consent for a certain time
interval and their systolic blood pressure was
recorded before using OC and while using OC.
 Find if the systolic blood pressure (SBP) is lower
after taking OC among these women using the
data given in the table.
Data: Systolic Blood Pressure (SBP) Readings

ID of Participant SBP level while not SBP level while


using OC using OC
Women 1 115 128
Women 2 112 115
Women 3 107 106
Women 4 119 128
Women 5 115 122
Women 6 138 145
Women 7 126 132
Women 8 105 109
Women 9 104 102
Women 10 115 117
Women 11 110 105
Women 12 140 125
Non-parametric tests
 In Medical Research, most of the variables often
do no follow the normal distribution (i.e. they are
skewed).
 So, we can not use the parametric tests like z-
test and t-test to reach any conclusion(s).
 Thus, we need to use non-parametric test(s).
 Non-parametric tests do not pose any restriction
on the data (i.e. shape of the distribution).
 The most important non-parametric test used in
the Medical Research and literature is the
famous χ2-test.
χ2-test

χ2-test: There is no assumption made


about the parameters of the population
from which the samples are drawn.
χ2-test is applied mostly in:
a. Testing the goodness of fit
b. Testing the Independence between
attributes.
Conditions for applying χ2-test (1)

The frequencies used must be absolute


not relative.
The total number of observations must be
at least 50. Sample size less than 50 does
not give good result.
The expected frequency of any item or
individual cell must not be less than 5.
Conditions for applying χ2-test (2)

In case of individual frequency less than 5,


the adjustment must be done by pooling
the adjacent cell frequencies until the cell
frequency becomes equal to or more than
5.
While doing so, adjustment in the degree
of freedom must also be done.
Alternatively, adjusted chi-square test or
exact test should be used.
Application of χ2-test in testing the
goodness of fit

 χ2-test is used to test whether a set of


observed frequencies support the
hypothesis of a particular distribution.
 This process is known as test of goodness
of fit.
 For instance, we may want to test whether
the given set of data follow the uniform,
binomial, poisson or normal distribution.
χ2-statistic for Goodness of Fit

n
(Oi  Ei ) 2
 
2
~  (  n  1)
2

i 1 Ei
Where,
O = Observed frequency
E = Expected frequency
v = degree of freedom
n = no. of observations
Example 1
The following table gives the number of
wrong diagnosis by a new intern at KUTH,
Dhulikhel during the various days of the
week. Find whether the number of wrong
diagnosis is uniformly distributed over the
week.
Days: S S M T W T F
 WD: 8 9 7 6 7 6 8
Hypothesis:

H0: Wrong diagnosis is uniformly


distributed over a week.
H1: Wrong diagnosis is not uniformly
distributed over a week.
Calculation:

Days O E O–E (O – E)2 (O – E)2/E


Sat 8 51/8 0.7 0.049 0.067
Sun 9 =7.3 1.7 2.890 0.396
Mon 7 - -0.3 0.090 0.012
Tue 6 - -1.3 1.690 0.232
Wed 7 - -0.3 0.090 0.012
Thu 6 - -1.3 1.690 0.232
Fri 8 - 0.7 0.490 0.067
Total 51 51 1.02
Solution:
 χ2 = Σ [(O – E)2/E] = 1.02
 Degree of freedom = ν = 7 – 1 = 6
 Tab χ26, 0.05 = 12.592
 Decision: Since the computed value of χ2 is less
than its tabulated value the null hypothesis is
accepted
 That is, the wrong diagnosis is uniformly
distributed over a week.
 In other words, the intern is not prone to make
wrong diagnosis on weekends.
Practice

Solve this example using SPSS.


Exercise 23
 A marketing researcher interested in the medical
publication reading habits of purchasing agents
has assembled the following data:
Medical publication preference (first choice)
Medical Publication Frequency of FC
Lippincot 65
Harper 60
Harrison 75
Robbins 80
Park & Park 95
 Test that there are no differences among
frequencies of first choice of tested publications
using SPSS as well.
Example 2

Among 64 off-springs of a certain cross


between guinea pigs, 34 were red, 10
were black and 20 were white. According
to the genetic model these number should
be in the ratio of 9:3:4. Are the data
consistent with the model at 5% level?
Hypothesis:

H0: The data is consistent with the model


i.e. the theory fits the given data.
H1: The data is not consistent with the
model.
Note: Under H0, we have the total of the
ratio = 9 + 3 + 4 = 16
Calculation, solution and decision:
Color O E O–E (O – E)2 (O – E)2/E
Red 34 36 -2 4 0.11
Black 10 12 -2 4 0.33
White 20 16 4 16 1.00
Total 64 64 1.44
E (Red) = 64 x (9/16) = 36 E (Black) = 64 x (3/16) = 12
E (White) = 64 x (4/16) = 16

x2 (cal) = 1.44 x2 (tab) = 5.99


Since, x2 (cal) < x2 (tab) we accept the null hypothesis i.e. the data is
consistent with the model.
Practice!

Use SPSS to solve this example.


Exercise 24

Among 57 off-springs of a certain cross


between guinea pigs, 40 were red, 14
were black and 21 were white. According
to the genetic model these number should
be in the ratio of 6:5:4. Are the data
consistent with the model at 1% risk?

Also use SPSS to solve this sum.


Example 3
A survey of 200 families having three
children each selected at random gave
following results:
Male births: 0 1 2 3
Families: 40 58 62 40
Test the hypothesis that male and female
births are equally likely at 1% risk.

Also use SPSS to solve this sum.


Hypothesis:
H0: p = ½ = 0.50, the male and female
births are equally likely, or, the binomial
distribution fit the data.
H1: p ≠ ½ ≠ 0.50, the male and female
births are not equally likely, or the binomial
distribution does not fit the data.
α = 0.05, ν = n – 1 = 4 – 1 = 3
Calculation, solution and decision:
M. B. O E O–E (O – E)2 (O – E)2/E
(x) (N.p)
0 40 25 15 225 9.0
1 58 75 -17 289 3.85
2 62 75 -13 169 2.25
3 40 25 15 225 9.0
Total 64 64 24.1
Since the success (male births) follows binomial distribution we use
the expected binomial frequencies i.e. E (x) = N.p = N (nCr pr qn-r)
x2 (cal) = 24.1 x2 (tab) = 11.345
Since, x2 (cal) > x2 (tab) we reject the null hypothesis i.e. male and
female births are not equally probable or the binomial distribution is
not a good fit for the given data.
What did you find from SPSS?
Note: χ2 test as Goodness of Fit
 For Binomial distribution the degree of freedom
is n – 1.
 For Poisson distribution the degree of freedom is
n – 2.
 For Normal distribution the degree of freedom is
n – 3.
 You should pool (add) your data if the frequency
is less than 5.
 You will lose one degree of freedom for every
pooling (adding two values)
Exercise 26
 A typist makes mistake per pages presented as
below. Fit a poisson distribution to the data and
test for goodness of fit.
No of mistakes No. of pages
0 123
1 59
2 14
3 3
4 1

Also use SPSS to solve this sum.


Thank you!!!

You might also like