Professional Documents
Culture Documents
tests, continued
Hypothesis test:
observed mean null mean
Z
s
n
Confidence Interval
s
confidence interval observed mean Z/2 * ( )
n
Hypothesis test:
Confidence Interval
s
confidence interval observed mean Tn 1,/2 * ( )
n
What is a T-distribution?
Students t Distribution
Note: t
Z as n increases
Standard
Normal
(t with df = )
t (df = 13)
t-distributions are bellshaped and symmetric, but
have fatter tails than the
normal
t (df = 5)
0
from Statistics for Managers Using Microsoft Excel 4th Edition, Prentice-Hall 2004
Students t Table
Upper Tail Area
df
.25
.10
.05
Let: n = 3
df = n - 1 = 2
= .10
/2 =.05
2.920 t
t distribution values
With comparison to the Z value
Confidence
t
Level
(10 d.f.)
t
(20 d.f.)
t
(30 d.f.)
Z
____
.80
1.372
1.325
1.310
1.28
.90
1.812
1.725
1.697
1.64
.95
2.228
2.086
2.042
1.96
.99
3.169
2.845
2.750
2.58
Note: t
Z as n increases
from Statistics for Managers Using Microsoft Excel 4th Edition, Prentice-Hall 2004
What does t look like mathematically? (You may at least recognize some resemblance
to the normal distribution function)
Where:
v is the degrees of freedom
(gamma) is the Gamma function
is the constant Pi (3.14...)
The normality
assumption
Conclusions
Practice Problem:
Answer
1. What is your null hypothesis?
Null hypothesis: mean life = 1520 hours
Alternative hypothesis: mean life < 1520 hours
2. What is your null distribution?
Since we have to estimate the standard deviation, we need to make inferences from a T-curve with 39
degrees of freedom.
X 40 ~ t39 (1520, s X
86
40
13.5)
1505 1520
1.11
13.5
p value P(t39 1.11) .137
t39
5. Probably not sufficient evidence to reject the null. We cannot sue the light bulb manufacturer for false
advertising! Notice that using t-distribution to calculate the p-value didnt change much! With n>30, might
as well use Z table.
Practice problem
Answer (a,b)
a. Calculate the sample mean.
8
X8
X
i 1
2 3 4 5 6 6 7 7 40
5.0
8
8
s X2
i 1
( X i 5) 2
8 1
s X 3.4 1.9
32 2 2 12 0 2(12 ) 2(2 2 ) 24
3.4
7
7
Answer (c)
c. Calculate the standard error of the mean.
sX
sX
n
1.9
8
.67
Answer (d)
d. Calculate the 99% confidence interval.
mean s X (t df , / 2 )
5.0 .67(3.50) (2.65, 7.35)
t7,.005=3.5
Answer
1.Defineyourhypotheses(null,alternative)
H0: P(average servings)=5.0
Ha: P(average servings)5.0 servings (two-sided)
2.Specifyyournulldistribution
X 24
1.7
~T23 (5.0,
0.34)
24
Answer, continued
3.Doanexperiment
observed mean in our experiment = 3.7 servings
4.Calculatethep-valueofwhatyouobserved
T23
3 .7 5
3.8
0.34
5.Rejectorfailtoreject(~accept)thenullhypothesis
Reject! Stanford affiliates eat significantly fewer than the
recommended servings of fruits and veggies.
T23 critical
value for
p<.05, two
tailed = 2.07
BP Before (diastolic)
BP After
100
92
89
84
83
80
98
93
108
98
95
90
Diastolic BP Before
D. BP After
Change
100
92
-8
89
84
-5
83
80
-3
98
93
-5
108
98
-10
95
90
-5
8 5 3 5 10 5 36
6
6
6
Change
-8
( 8 6) 2 ( 5 6) 2 ( 3 6) 2 ...
sx
5
4 1 9 1 16 1
sx
2.5
6
32
2.5
5
-5
-3
-5
1.0
60
T5
6
1.0
-10
-5
-8
(-3.43,- 8.571)
-5
-3
-5
-10
-5
Summary: Single
population mean (small n,
Hypothesis test:
normality)
observed mean null mean
t n 1
sx
n
Confidence Interval
sx
confidence interval observed mean t n -1,/2 * ( )
n
Hypothesis test:
observed mean d 0
t n 1
sd
n
Where
d=change over
time or
difference
within a pair.
Confidence Interval
sd
confidence interval observed mean d t n -1,/2 * ( )
n
Summary: Single
population mean (large n)
Hypothesis test:
observed mean null mean
Z t n 1
sx
n
Confidence Interval
sx
Z/2 ] * ( )
n
Examples of Sample
Statistics:
Single population mean (known )
Single population mean (unknown )
Single population proportion
Difference in means (ttest)
Difference in proportions (Z-test)
Odds ratio/risk ratio
Correlation coefficient
Regression coefficient
Recall: normal
approximation to the
binomial
Differs by
a factor
of n.
x np (1 p )
For proportion:
P-hat stands for sample
proportion.
p p
np (1 p) p (1 p)
2
n
n
p (1 p )
p
n
p
2
Differs
by a
factor
of n.
Sampling distribution of a
sample proportion
p p
p
s p
p(1 p )
n
p (1 p )
n
p ~ Normal ( p,
p (1 p )
)
n
Always a normal
distribution!
Practice Problem
A fellow researcher claims that at least 15% of smokers
fail to eat any fruits and vegetables at least 3 days a week.
You find this hard to believe and decide to check the
validity of this statistic by taking a random (representative)
sample of smokers. Do you have sufficient evidence to
reject your colleagues claim if you discover that 17 of the
200 smokers in your sample eat no fruits and vegetables at
least 3 days a week?
Answer
1. What is your null hypothesis?
Null hypothesis: p=proportion of smokers who skip fruits and veggies frequently >= .15
Alternative hypothesis: p < .15
2. What is your null distribution?
Var( ) = .15*.85/200 = .00064 SD( ) = .025
~pN (.15, .025)
p
p
3. Empirical evidence: 1 random sample: = 17/200 = .085
4. Z = (.085-.15)/.025 = -2.6
p-value = P(Z<-2.6) = .0047
5. Sufficient evidence to reject the claim.
Practice Problem
In Saturdays newspaper, in a story about poll results from
Ohio, the article said that 625 people in Ohio were sampled
and claimed that the margin of error in the results was 4%.
Can you explain where that 4% margin of error came from?
Answer
.5 * .5 .5
5
1
2%
625
25 250 50
4% is 2 standard errors.
Since, we' re on a normal distribution, 2 standard errors on either
side of the mean, should represent 95% confidence...
S p
p p0
.666 .5
1.29; p .05
( p0 )(1 p0 )
(.5)(.5)
15
n
Key one-sample
Hypothesis Tests
Test for Ho: = 0 t n 1
x 0
sx
n
p p 0
( p 0 )(1 p 0 )
n
Tn-1 approaches
Z for large n.
** If np (expected
value)<5, use exact
binomial rather
than Z
approximation
Corresponding confidence
intervals
For a mean: x t n 1, / 2 s x
For a proportion: p Z
/2
Tn-1 approaches
Z for large n.
( p )(1 p )
** If np
(expected
value)<5,
use exact
binomial
rather than
Z
approximati
on
Symbol overload!
n: Sample size
Z: Z-statistic (standard normal)
tdf: T-statistic (t-distribution with df degrees of
freedom)
p: (p-hat): sample proportion
X: (X-bar): sample mean
s: Sample standard deviation