T Test
T Test
‘t’ Test
When to use test for Means
• Mean of population µ
• Std error of sample mean
• Confidence level
• Confidence Interval- 1
• t/z value (sample mean)
• P value (t/Z statics)
test of Means
the z/t-test assesses whether the means of two groups
are statistically different from each other. this analysis
is appropriate whenever you want to compare the
means of two groups
test of Means
there are two different parametric tests that can be
used to test hypotheses about single mean or to
compare two means
1. Z-test for large samples(>100 or 120)
(variance of the population is known)
Nominal No
Ordinal No
Interval Yes
Ratio Yes
Sample Size
Independent Related
Samples Samples
also called dependent means
test
2.5% 2.5%
Mean Mean
A known
value
Mean
5%
Population Characteristics
16
Solution
Given
n = 30.5
n = 14
s = 10.63918736
α = .05
17
Solution
b. Assumptions
• simple random sample
• variance is unknown
• normally distributed
18
Solution
c. Hypotheses
H0: μ = 35
HA: μ 35
19
Solution
d. Statistical Test
⚫ Test statistic
20
Solution
d. Statistical Test
⚫ Distribution of test statistic
If the assumptions are correct and H0 is true, the test statistic follows
Student's t distribution with 13 degrees of freedom.
21
Solution
d. Statistical Test
⚫ Decision criteria
We have a two tail test. With α = .05 it means that each tail is 0.025. The
critical t values with 13 df are -2.1604 and 2.1604.
22
decision criteria
23
Solution
24
Solution
f. Discussion
Do not reject the null hypothesis because -1.58 is not in the rejection
region.
25
Solution
g. Conclusions
26
Example 2 : Computation of One Sample
A sample of heights of 25 female students of age group
t-tests
12-15 yrs is collected from : school. We want to
a public
check if there is any difference in the mean height of
the sample from the standard height (62 inches)
Interpretations of result:
Observed P-value for t -test (Sig 2-tailed) = .362 >.05
so we CAN NOt REJECt Null Hypothesis and found that there is no significant
difference between the sample height and pop mean or we can interpret that sample is
coming from this population only
Example 3: One sample t test
Interpretations of result:
Observed P-value for t -test (Sig 2-tailed) = .000 <.05 so we REJECt Null Hypothesis
and our alternative will be accepted i.e. there is significant difference in blood
pressures and this is not by chance.
t-test for difference of means for
two Independent samples
t-test for difference of means for
two Independent samples
Underlying Assumptions
1. the samples (n1 and n2) from two normal populations are
independent
2. One or both sample sizes are less than 30 ,randomly drawn
3. the unknown variances of the two populations are equal
4. Measurement on ratio or interval scale
5.Separate variance t-test by Satterwaite is used
Example 5 : two Independent Sample
t-tests
Problem: The addition of bran to the diet has been reported to benefit patients with
diverticulitis. Several different bran preparations are available, and a clinician wants
to test the efficacy of two of them on patients, since favorable claims have been
made for each. Among the consequences of administering bran that requires testing
is the transit time through the alimentary canal.
Research Question:-Does it differ in the two groups of patients taking these two
preparations?
Null Hypothesis There is no significant difference
between the mean of two samples i.e. mean of first
sample = mean of second sample
Sample 1 44 51 52 55 60 62 66 68 69 71 71 76 82 91 108
(treatA)
Sample 2 52 64 68 74 79 83 84 88 95 97 101 116
(treat_B)
With treatment A the mean transit time was 68.40 h and with treatment B
83.42 h. What is the significance of the mean difference 15.02h?
Results provided by
SPSS
Null
Ho: mean Height Group 1 = mean Height Group 2
Alternative (Research)
Ha: mean Height Group 1 ≠ mean Height Group 2
Output provided by SPSS
Null
Ho: mean number FB Friends for Group 1 = mean number FB Friends Group 2
Alternative (Research)
Ha: mean number FB Friends for Group 1 ≠ mean number FB Friends Group 2
Paired t-test for Dependent
Means
Paired t-test for Dependent Means
Underlying assumptions:
• Interval or ratio scale of measurement (approximately
interval)
• Random sampling from a defined population
• Samples or sets of data used to produce the difference
scores are linked in the population through repeated
measurement, natural association, or matching
• Scores are normally distributed in the population;
difference scores are normally distributed
1. In a certain experiment to compare two types of animal
foods A and B fed to the same set of 8 animals, the following
set of observations of increase in weights were observed. Can
we conclude that food B is better than A?
animals 1 2 3 4 5 6 7 8
Increase in weight (lbs) food A
49 53 51 52 47 50 52 53
Increase in weight in lbs food B
52 55 52 53 50 54 54 53
Example 7 : Paired Samples t-tests:
To test the effect of drug on a group 25 people in the age group of 25-35 yrs. the data
has been collected prior to the drug treatment as well as post treatment.
In this case, we will comparing the means of two samples just like we did in an
Independent sample t-test but here our samples will NOt be independent. Instead, our
data will be in paired or dependent sets.
Research Question :
Is there a significant difference between Pretest and posttest scores
the data is paired because each person takes the pretest and than the posttest
Output Provided by SPSS:
Interpretation of results: the p value .165> .05 so we can’t reject null hypothesis
and cannot really conclude that the two treatments have different effect.
‘z’- Test
(A) Sampling from a normally distributed
population--variance known (variance unknown one
sample t test)
Example 9
83
Solution
a. Data
n = 10 = 20
= 27 α = .05
84
Solution
b. Assumptions
• simple random sample
• normally distributed population
85
Solution
c. Hypotheses
H0 : μ = 30
HA : μ 30
86
Solution
d. Statistical test
⚫ Test statistic
87
Solution
d. Statistical test
⚫ Distribution of test statistic
88
Solution
d. Statistical test
⚫ Decision criteria
89
Solution
d. Statistical test
⚫ Decision criteria
90
Solution
d. Statistical test
Decision criteria
91
Solution
e. Calculations
92
Solution
f. Discussion
93
Solution
g. Conclusions
We conclude that μ is not 30.
p = .0340
94
Confidence interval
95
Solution
96
Solution
a. Given
n = 10 = 20
= 27 α = .05
97
Solution
b. Assumptions
• simple random sample
• normally distributed population
98
Solution
c. Hypotheses
H0: μ 30
HA: μ < 30
99
Solution
d. Statistical test
⚫ Test statistic
100
Solution
d. Statistical Test
⚫ Distribution of test statistic
101
Solution
d. Statistical Test
⚫ Decision criteria
102
Solution
d. Statistical Test
⚫ Decision criteria
103
Solution
d. Statistical Test
⚫ Decision criteria
With α = .05 and the inequality we have the entire rejection region
at the left. The critical value will be z = -1.645. Reject H0 if z <
-1.645.
104
Solution
e. Calculations
105
Solution
f. Discussion
106
Solution
g. Conclusions
p = .0170 this time because it is only a one tail test and not a two tail
test.
107
Sampling is from a population that is not
normally distributed
Example 11
108
Solution
a. Given
n = 242 s = 12.14
= 33.3 α = .05
109
Solution
b. Assumptions
• simple random sample
• population is similar to those subjects in the sample
(cannot assume normal distribution)
110
Solution
c. Hypotheses
H0: μ 30
HA: μ > 30
111
Solution
d. Statistical Test
⚫ Test statistic
112
Solution
d. Statistical Test
⚫ Distribution of test statistic
113
Solution
d. Statistical Test
⚫ Decision criteria
This is a one tail test with α = .05. The rejection region is at the right
of the value z = 1.645.
114
115
Solution
e. Calculations
116
Solution
f. Discussion
117
Solution
g. Conclusion
118
B) Hypothesis testing of the difference between
two population means (Indepent sample t test)
(continued)
119
Sampling is from normally distributed populations
with known variances
120
Example 12
121
Solution
a. Given
= 4.5 n1 = 12 σ12 = 1
122
Solution
b. Assumptions
• two independent random samples
• each drawn from a normally distributed population
123
Solution
c. Hypotheses
H0 : μ 1 = μ 2
HA : μ 1 μ2
124
Solution
125
Solution
d. Statistical Test
⚫ Distribution of Test Statistic
126
Solution
d. Statistical Test
⚫ Decision criteria
127
Solution
128
Solution
e. Calculations
129
Solution
f. Discussion
Reject H0 because 2.57 > 1.96.
130
Solution
g. Conclusion
From these data, it can be concluded that the population means are
not equal. A 95% confidence interval would give the same conclusion.
p = .0102.
131
Sampling from populations that are not
normally distributed -- Example 7.3.4
These data were obtained in a study comparing persons with
disabilities with persons without disabilities. A scale known as the
Barriers to Health Promotion Activities for Disabled Persons (BHADP)
Scale gave the data. We wish to know if we may conclude, at the 99%
confidence level, that persons with disabilities score higher than
persons without disabilities.
132
Solution
a. Given
133
Solution
b. Assumptions
134
Solution
c. Hypotheses
H0 : μ 1 μ2
HA : μ 1 > μ 2
135
Solution
136
Solution
d. Statistical Test
⚫ Distribution of Test Statistic
137
Solution
d. Statistical Test
⚫ Decision criteria
With α = .01 and a one tail test, the critical value of z is 2.33. We
reject H0 if z > 2.33.
138
Solution
139
Solution
f. Discussion
140