t test
TRANSCRIPT
11
The t testThe t test
prepared byprepared byB.saikiranB.saikiran
(12NA1E0036)(12NA1E0036)
IntroductionIntroduction The t-test is a basic test that is limited to The t-test is a basic test that is limited to
two groups. For multiple groups, you two groups. For multiple groups, you would have to compare each pair of would have to compare each pair of groups, for example with three groups groups, for example with three groups there would be three tests (AB, AC, BC), there would be three tests (AB, AC, BC), whilst with seven groups there would whilst with seven groups there would need to be 21 tests.need to be 21 tests.
The basic principle is to test the The basic principle is to test the null null hypothesishypothesis that the means of the two that the means of the two groups are equal.groups are equal.
The t-test assumes: The t-test assumes: A normal distribution (A normal distribution (parametricparametric data) data) Underlying Underlying variancesvariances are equal (if not, use Welch's are equal (if not, use Welch's
test)test) It is used when there is random assignment It is used when there is random assignment
and only two sets of measurement to compare.and only two sets of measurement to compare. There are two main types of t-test:There are two main types of t-test:
Independent-measures t-testIndependent-measures t-test: when samples are : when samples are not matched.not matched.
Matched-pair t-testMatched-pair t-test: When samples appear in pairs : When samples appear in pairs (eg. before-and-after).(eg. before-and-after).
A single-sample t-test compares a sample A single-sample t-test compares a sample against a known figure, for example where against a known figure, for example where measures of a manufactured item are measures of a manufactured item are compared against the required standard.compared against the required standard.
44
ApplicationsApplications
To compare the mean of a sample To compare the mean of a sample with population mean.with population mean.
To compare the mean of one sample To compare the mean of one sample with the mean of another independent with the mean of another independent sample.sample.
To compare between the values To compare between the values (readings) of one sample but in 2 (readings) of one sample but in 2 occasions.occasions.
55
1.Sample mean and population 1.Sample mean and population meanmean
The general steps of testing hypothesis The general steps of testing hypothesis must be followed.must be followed.
Ho: Sample mean=Population mean.Ho: Sample mean=Population mean. Degrees of freedom = n - 1Degrees of freedom = n - 1
SE
Xt
66
ExampleExample
The following data represents hemoglobin The following data represents hemoglobin values in gm/dl for 10 patients:values in gm/dl for 10 patients:
Is the mean value for patients significantly Is the mean value for patients significantly differ from the mean value of general differ from the mean value of general population population
(12 gm/dl) . Evaluate the role of chance.(12 gm/dl) . Evaluate the role of chance.
10.510.5 99 6.56.5 88 1111
77 7.57.5 8.58.5 9.59.5 1212
77
SolutionSolution
Mention all steps of testing hypothesis.Mention all steps of testing hypothesis.
Then compare with tabulated value, for 9 df, and 5% level of Then compare with tabulated value, for 9 df, and 5% level of significance. It is = 2.262significance. It is = 2.262
The calculated value>tabulated value.The calculated value>tabulated value.Reject Ho and conclude that there is a statistically significant Reject Ho and conclude that there is a statistically significant
difference between the mean of sample and population difference between the mean of sample and population mean, and this difference is unlikely due to chance.mean, and this difference is unlikely due to chance.
352.5
10
80201.11295.8
t
88
99
2.Two independent samples2.Two independent samples
The following data represents weight in Kg for The following data represents weight in Kg for 10 males and 12 females.10 males and 12 females.
Males:Males:
Females:Females:
80 75 95 55 60
70 75 72 80 65
60 70 50 85 45 60
80 65 70 62 77 82
1010
2.Two independent samples, 2.Two independent samples, cont.cont.
Is there a statistically significant difference Is there a statistically significant difference between the mean weight of males and between the mean weight of males and females. Let alpha = 0.01females. Let alpha = 0.01
To solve it follow the steps and use this To solve it follow the steps and use this equation.equation.
)11
(2
)1()1(
2121
222
211
21
nnnn
SnSn
XXt
1111
ResultsResults
Mean1=72.7 Mean2=67.17Mean1=72.7 Mean2=67.17 Variance1=128.46 Variance2=157.787Variance1=128.46 Variance2=157.787 Df = n1+n2-2=20Df = n1+n2-2=20 t = 1.074t = 1.074 The tabulated t, 2 sides, for alpha 0.01 is The tabulated t, 2 sides, for alpha 0.01 is
2.8452.845 Then accept Ho and conclude that there is no Then accept Ho and conclude that there is no
significant difference between the 2 means. significant difference between the 2 means. This difference may be due to chance.This difference may be due to chance.
P>0.01P>0.01
1212
3.One sample in two 3.One sample in two occasionsoccasions
Mention steps of testing hypothesis.Mention steps of testing hypothesis. The df here = n – 1.The df here = n – 1.
n
sdd
t
1
)( 22
n
n
dd
sd
1313
Example: Blood pressure of 8 Example: Blood pressure of 8 patients, before & after patients, before & after treatmenttreatmentBP beforeBP before BP afterBP after dd dd22
180180 140140 4040 16001600
200200 145145 5555 30253025
230230 150150 8080 64006400
240240 155155 8585 72257225
170170 120120 5050 25002500
190190 130130 6060 36003600
200200 140140 6060 36003600
165165 130130 3535 12251225
Mean Mean d=465/8=58.125d=465/8=58.125
∑∑d=465d=465 ∑∑dd22=2917=291755
1414
Results and conclusionResults and conclusion
t=9.387t=9.387 Tabulated t (df7), with level of Tabulated t (df7), with level of
significance 0.05, two tails, = 2.36significance 0.05, two tails, = 2.36 We reject Ho and conclude that there We reject Ho and conclude that there
is significant difference between BP is significant difference between BP readings before and after treatment.readings before and after treatment.
P<0.05.P<0.05.