0% found this document useful (0 votes)
12 views141 pages

T Test

The document outlines the use of 't' tests and z-tests for comparing means between groups, detailing when to use each test based on sample size and population characteristics. It explains the assumptions required for conducting these tests, including the scale of measurement and the distribution of the population. Additionally, it provides examples of hypothesis testing with practical applications in various scenarios, such as blood pressure and body mass index.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views141 pages

T Test

The document outlines the use of 't' tests and z-tests for comparing means between groups, detailing when to use each test based on sample size and population characteristics. It explains the assumptions required for conducting these tests, including the scale of measurement and the distribution of the population. Additionally, it provides examples of hypothesis testing with practical applications in various scenarios, such as blood pressure and body mass index.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 141

test of Means

‘t’ Test
When to use test for Means

• to investigate the question of whether the children (10-12 years) of


city A and city B have the same average height/weight/IQ
• to test the blood pressure of a particular group of patients with the
standard systolic blood pressure.
• to study the efficacy of a new mouthwash solution on a group of
users (before and after)
Statistics for testing 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)

2. t- test for small samples ( certainly < 30 and


preferably <60, variance of population is
unknown)

*** to compare more than two means we would use AVOVA


How to Select the Appropriate test
There are four main questions that you need to ask
when trying to determine which is the appropriate
statistical test of means for your research problem
1. What is the scale of measurement of the
variable?
2. What is the sample size ?
3. How many no of samples are collected ?
4. Are the samples dependent or independent?
5. What are the population characteristics?
6. Have you met the assumptions of the
statistical test selected?
Scale of Measurement
Scale of Measurement Parametric test

Nominal No

Ordinal No

Interval Yes

Ratio Yes
Sample Size

• Sample size small- t test (less than 30)


• Sample size large – z test (30 or more)
Number of Samples
One-Sample tests 1. One sample t-test/ z
test
2. t-test for difference of
means for independent
two-Sample tests samples / z test*

3. Paired t-test for dependent


samples/ z test **

* 2 experimental conditions and different participants were


assigned to each condition
** 2 experimental conditions and the same participants took
part in both conditions of the experiments
types of t-tests

Independent Related
Samples Samples
also called dependent means
test

Interval Independent Paired samples


measures/ samples t-test* t-test**
parametric
Ordinal/ Mann-Whitney Wilcoxon test
non-parametri U-test
c
* 2 experimental conditions and different participants were assigned to each condition
** 2 experimental conditions and the same participants took part in both conditions of the experiments
types of z/t-tests cont.

• 2-tailed tests vs one-tailed tests • 2 sample t-tests vs 1 sample


t-tests

2.5% 2.5%

Mean Mean

A known
value

Mean
5%
Population Characteristics

• Population is normally distributed


• Variance of population is known –z test ; Variance is unknown t test.
One Sample t test
t-test Assumptions for
single mean
• Interval or ratio scale of measurement (approximately
interval)
• Random sampling from a defined population
• Characteristic is normally distributed in the population
• Population variance is unknown
Application – One sample t test

To test the blood pressure of a particular group of patients with


the standard systolic blood pressure.
To test the decrease in average life of patients suffering from a
particular disease. Etc.
Example 1. Body mass index
A simple random sample of 14 people from a certain population gives body mass
indices as shown in Table. Can we conclude that the BMI is not 35? Let α = .05.

Sampling is from a normally distributed population--variance unknown.

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.

We reject H0 if the t -2.1604 or t 2.1604.

22
decision criteria

23
Solution

e. Calculation of test statistic

24
Solution

f. Discussion

Do not reject the null hypothesis because -1.58 is not in the rejection
region.

25
Solution

g. Conclusions

Based on the data of the sample, it is possible that


μ = 35. The value of p = .1375

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)

Ho: mean of population = mean of sample


Ha: mean of population ≠mean of sample

this will be two tailed with alpha = .05


Output provided by SPSS

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

Average systolic blood pressure of a normal male is


supposed to be about 129. Measurements of systolic blood
pressure on a sample of 12 adult males from a community
whose dietary habits are suspected of causing high blood
pressure are listed below:
115 134 131 143 130 154 119 137 155 130 110 138
Do the data justify (α = 0.01) the suspicions regarding the
blood pressure of this community?
Example 4 : One sample t test
Weight Age
SBP Age
(kg)
90 12.5
38 12.5
88 12.1
45 12.1
100 13.6
35 13.6
70 10.0
50 10.0
80 11.2
60 11.2
90 12.0
45 12.0
100 13.4
30 13.4
102 13.8
51 13.8
120 16.8
53 16.8
110 15.6
40 15.6
89 12.3
43 12.3
80 12.0
39 12.0
90 12.7
41 12.7
100 13.7
40 13.7
87 12.0
50 12.0
93 12.8
56 12.8
82 11.6
52 111.6
102 14.0
62 14.0
93 13.0
39 13.0
86 11.9
44 11.9
Hypothesis:
We want to test that is there any significant difference
exist with the SBP of these children.
Here our null hypothesis will be SBP=120
and the alternative hypothesis will become
SBP ≠ 120
Output provided by SPSS

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

By random allocation the clinician selects two groups of


patients aged 40-64 with diverticulosis of comparable
severity. Sample 1 contains 15 patients who are given
treatment A, and sample 2 contains 12 patients who are
given treatment B. the transit times of food through the gut
are measured by a standard technique and the results are
recorded, in order of increasing time, in the followingtable .
transit time transit time of marker pellets through the alimentary canal of patients with diverticulosis on two
types of treatment: unpaired comparision

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

Interpretation of results: Will you Assume equal Variance?


to determine which row of numbers to use, we must look at the Sig (p-value)
for the F test i.e. .720>.05 means the variances are equal and we have to use
first row for t- test interpretations
Conti……
Results shows that at 25 degrees of freedom (that
is (15 - 1) + (12 - 1)), p = .031 is smaller than the
conventional level of 5%.
the null hypothesis that there is no difference
.
between the means is therefore somewhat unlikely
and we will reject our null hypothesis and conclude
that the difference in transit time is not by chance ,
it is significant due to different treatment.
Example 6: two Independent Sample
t-test
Research Question :
Does gender create a significant difference between the heights ?

Here we have two Groups


Group 1 (“1” in our data set ) represents male
Group 2 (“2” in our data set) represents female

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

1. ***Will you Assume equal Variance ?


to determine which row of numbers to use, we must look at the Sig (p-value) for
the F test, use first row
P-value for t -test (Sig 2-tailed) = .051> .05 so we CAN NOt REJECt Null Hypothesis means
Height of male and female are equal
Exercise
Research Question :
Does loving or hating Sports create a significant difference between the number of
Facebook Friends person has ?

Here we have two Groups


Group 1 (“1” in our data set ) dislikes sports
Group 2 (“5” in our data set) loves sports

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.

Ho: sample mean of pretest = sample mean of posttest


Ha: sample mean of pretest ≠ sample mean of posttest

this will be two tailed with alpha = .05

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:

P value(Sig 2-tailed) = .000


.0<.05 So we can REJECt the NULL and can conclude that there is
significant difference between pretest and posttest results.
Example 8: Dependent sample t
test
Study of bran in the treatment of diverticulosis.
the clinician wonders whether transit time would be
shorter if bran is given in the same dosage in three
meals during the day (treatment A) or in one meal
(treatment B). A random sample of patients with
disease of comparable severity and aged 20-44 is
chosen and the two treatments administered on two
successive occasions, the order of the treatments also
being determined from the table of random numbers.
the alimentary transit times and the differences for
each pair of treatments are set out in the following
table
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

A simple random sample of 10 people from a


certain population has a mean age of 27. Can
we conclude that the mean age of the
population is 30? The variance is known to be
20. Let α = .05.

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

If the assumptions are correct and H0 is true,


the test statistic follows the standard normal
distribution.

88
Solution

d. Statistical test
⚫ Decision criteria

Reject H0 if the z value falls in the rejection


region. Fail to reject H0 if it falls in the
nonrejection region.

89
Solution

d. Statistical test
⚫ Decision criteria

90
Solution

d. Statistical test
Decision criteria

Because of the structure of H0 it is a two tail


test. Therefore, reject H0 if z -1.96 or z
1.96.

91
Solution

e. Calculations

92
Solution

f. Discussion

We reject the null hypothesis because


z = -2.12 which is in the rejection
region. The value is significant at
the .05 level.

93
Solution

g. Conclusions
We conclude that μ is not 30.
p = .0340

⚫ A z value of -2.12 corresponds to an area of


.0170. Since there are two parts to the rejection
region in a two tail test, the p value is twice this
which is .0340.

94
Confidence interval

95
Solution

Same example as a one tail test.


Example 10 (reprise)
A simple random sample of 10 people from a
certain population has a mean age of 27. Can
we conclude that the mean age of the
population is less than 30? The variance is
known to be 20. Let α = .05.

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

If the assumptions are correct and H0 is true, the test statistic


follows the standard normal distribution. Therefore, we calculate a z
score and use it to test the hypothesis.

101
Solution

d. Statistical Test
⚫ Decision criteria

Reject H0 if the z value falls in the rejection region. Fail to reject H0


if it falls in the nonrejection region.

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

We reject the null hypothesis because


-2.12 < -1.645.

106
Solution

g. Conclusions

We conclude that μ < 30.

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

Maximum oxygen uptake data

Can we conclude that μ > 30?


Let α = .05.

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

By virtue of the Central Limit Theorem, the test statistic is


approximately normally distributed
with μ = 0 if H0 is true.

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

Reject H0 because 4.23 > 1.645.

117
Solution

g. Conclusion

The maximum oxygen uptake for the sampled population is greater


than 30.
The p value < .001 because 4.23 is off the chart (p(3.89) < .001).
Actual value p=1.17 x 10-5 (.0000117)

118
B) Hypothesis testing of the difference between
two population means (Indepent sample t test)

This is a two sample z test which is used to determine if two population


means are equal or unequal. There are three possibilities for
formulating hypotheses.

(continued)

119
Sampling is from normally distributed populations
with known variances

120
Example 12

Serum uric acid levels: Is there a difference between the means


between individuals with Down's syndrome and normal individuals?

121
Solution

a. Given

= 4.5 n1 = 12 σ12 = 1

= 3.4 n2 = 15 σ22 = 1.5 α = .05

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

d. Statistical test -- This is a two sample z test.

125
Solution

d. Statistical Test
⚫ Distribution of Test Statistic

If the assumptions are correct and H0 is true, the test statistic is


distributed as the normal distribution.

126
Solution

d. Statistical Test
⚫ Decision criteria

With α = .05, the critical values of z are -1.96 and +1.96. We


reject H0 if z < -1.96 or z > +1.96.

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

Disabled: = 31.83 n1 = 132 s1 = 7.93


Nondisabled: = 25.07 n2 = 137 s2 = 4.80
α = .01

133
Solution

b. Assumptions

• independent random samples

134
Solution

c. Hypotheses

H0 : μ 1 μ2

HA : μ 1 > μ 2

135
Solution

d. Statistical test -- Test statistic

Because of the large samples, the central limit theorem permits


calculation of the z score as opposed to using t. The z score is
calculated using the given sample standard deviations.

136
Solution

d. Statistical Test
⚫ Distribution of Test Statistic

If the assumptions are correct and H0 is true, the test statistic is


approximately normally distributed

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

e. Calculation of test statistic

139
Solution

f. Discussion

Reject H0 because 8.42 > 2.33.

140

You might also like