Lecture 26 Compact
Lecture 26 Compact
Lecture 26 Compact
Five steps to hypothesis testing – one mean and mean of paired Example for testing one population mean:
difference: Summary Boxes on pages 558-559 and 562.
STEP 1: Determine the null and alternative hypotheses. Is mean human body temperature really 98.6 degrees, or is it
One population mean: Population mean of paired differences lower?
Null hypothesis: H0: µ = µ0 Null hypothesis: H0: µd = 0
Null value is called µ0 Null value = 0 (Note special null value) H0: µ = 98.6 degrees
Ha: µ < 98.6 degrees
Alternative hypothesis is one of these, based on context:
Ha: µ ≠ µ0 Ha: µd ≠ 0
Ha: µ > µ0 Ha: µd > 0 n = 101 blood donors at clinic near Seattle, ages 17 to 84
Ha: µ < µ0 Ha: µd < 0
Sample mean = x = 97.89 degrees,
Sample standard deviation = s = 0.73 degrees
s 0.73
= = 0.073
Standard error = s.e.( x ) = n 101
Example for testing population mean of paired differences: STEP 2:
Verify data conditions. If met, summarize data into test statistic.
Do people gain or lose weight when they quit smoking? American
Journal of Public Health, 1983, pgs 1303-05. Data conditions:
Bell-shaped data (no extreme outliers or skewness) or large sample.
For each person, di = difference in weight (after – before) for Test statistic (remember, use t for means):
people who quit smoking for 1 year. (Positive = weight gain)
sample statistic − null value
µd = population mean weight gain in 1 year for smokers who quit. t=
(null) standard error
H0 : µ d = 0 One population mean: Mean of paired differences:
Ha : µ d ≠ 0 Sample statistic = x Sample statistic = d
Null value = µ0 Null value = 0
n = 322, Sample mean = d = 5.15 pounds, s sd
Sample standard deviation = sd = 11.45 pounds Null standard error = n Null standard error = n
sd 11.45
= = .6381
Standard error of d = n 322 Note that the word “null” is unnecessary in std. error involving means.
Example for mean of paired differences Alternative hypothesis (similar for µd): p-value is:
(Population mean weight loss after quitting smoking = 0?): Ha: µ > µ0 (a one-sided hypothesis) Area above the test statistic t
Ha: µ < µ0 (a one-sided hypothesis) Area below the test statistic t
sample statistic − null value 5.15 − 0 5.15 Ha: µ ≠ µ0 (a two-sided hypothesis) 2 × the area above |t| = area in
t= = = = 8.07
(null) standard error 11.45 .6381 tails beyond −t and t
322
Use Table A.3 on page 729: Area above 2.20, df = 14
One-Sided p-values for Significance Tests Based on a t-Statistic
Table will provide a p-value range, not an exact p-value.
Can also use Excel or R Commander.
Ex: n = 15, df = 14, t = 2.20
Ha: µ > µ0
p-value = area above 2.20
Since 2.20 is between 2.00
and 2.33, p-value is between
.033 and .018:
.018 < p-value < .033
Double it for two-sided:
Ha: µ ≠ µ0
.036 < p-value < .066
Use with negative values for
Ha: µ < µ0
0.05
0.025 0.025
-1.66 0 -1.98 0 1.98
test statistic t test statistic t
If the test statistic is in the rejection region: Note: We found a 95% confidence interval for this in an earlier lecture.
• Reject the null hypothesis. It was 97.75 to 98.03 degrees.
• Accept the alternative hypothesis
• The result is statistically significant Example 2:
The mean change in weight for one year after quitting smoking is
For both examples, the test statistic is definitely in the rejection region, significantly different from 0.
so we reject the null hypothesis.
Note: A 95% confidence interval for the mean change is weight is:
5.15 ± 1.97(.638) or 3.89 to 6.41 pounds.
Possible problem: No control group! People gain weight as they age.
Hypothesis test for difference in two means, independent samples New Example: Work through from start to finish
Called a “two-sample t-test” or “independent samples t-test.”
You already learned how to do this with R Commander. Research question: Can drinking an ice slushie increase
endurance when exercising in hot weather?
Example from Exercise 11.51: Two-sample t-test to compare pulse for
those who do and don’t exercise
Australia study published in Medicine and Science in Sports and
• Data → New data set – give name, enter data Exercise, 2010
• One column for Exercise (Y,N) and one column for pulse
• Statistics → Means →Independent samples t-test • 10 Male volunteers, average age 28
• Choose the alternative (≠,>,<) and conf. level
data: Pulse by Exercises • Two treatments administered to all 10 men:
t = 1.7156, df = 13.014, p-value = 0.05496 o Drink fruit-flavored ice slushie
alternative hypothesis: true difference in means is not
equal to 0
o Drink fruit-flavored cold water
95 percent confidence interval: • Then run on treadmill in 93 degree room until exhausted
-1.727387 15.060720 • Response variable = time until exhaustion
sample estimates:
mean in group N mean in group Y • Order randomized, administered a few weeks apart
72.00000 65.33333 • Did some practice runs to eliminate “learning effect”
Parameter of interest:
µd = mean difference in exhaustion times if everyone in the
population were to run under both conditions.
Hypotheses:
H0: µd = 0 (Slushie and water have same effect on endurance)
Ha: µd > 0 (Slushie improves endurance)
Data and Test Statistic:
3.6
d = 9.5 minutes, sd = 3.6 minutes, so s.e.(d ) = = 1.14
10
9.5 − 0
t= = 8.3, df = 9, p-value ≈ 0.
1.14
Reject H0, conclude ice slushie does increase endurance
compared to drinking cold water.
95% confidence interval is 9.5 ± 2.26(1.14) or 6.9 to 12.1 mins.