Download t distribution with df = n – 1.

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Degrees of freedom (statistics) wikipedia , lookup

History of statistics wikipedia , lookup

Confidence interval wikipedia , lookup

Taylor's law wikipedia , lookup

Bootstrapping (statistics) wikipedia , lookup

Statistical inference wikipedia , lookup

Misuse of statistics wikipedia , lookup

Resampling (statistics) wikipedia , lookup

Student's t-test wikipedia , lookup

Transcript
17. Inference for a population
mean (σ unknown)
The Practice of Statistics in the Life Sciences
Third Edition
© 2014 W.H. Freeman and Company
Objectives (PSLS Chapter 17)
Inference for the mean of one population (σ unknown)

When s is unknown

The t distributions

The t test

Confidence intervals

Matched pairs t procedures

Robustness
When s is unknown

The sample standard deviation s provides an estimate of the
population standard deviation s.

Larger samples give more reliable estimates of s.
Population
distribution
Large sample
Small sample
The t distributions
We take 1 random sample of size n from a Normal population N(µ,σ):


When s is known, the sampling distribution of x is Normal N(m, s/√n),
x  m 
z

and the statistic
follows the standard Normal N(0,1).
s n
When s is estimated from the sample standard deviation s, the

x  m
statistic t 
follows the t distribution t (0,1) with n − 1
s n
degrees of freedom.
Standard Normal
t distribution, df 4
t distribution, df 1
Standard Normal
t distribution, df 100
t distribution, df 20
When n is large, s is a good
estimate of s and the t df n – 1
distribution is close to the
standard Normal distribution.
Standard deviation versus standard error
For a sample of size n,
the sample standard deviation s is:
1
2
s
(
x

x
)
 i
n 1
n − 1 is the “degrees of freedom.”
The value s/√n is called the standard error of the mean SEM.
Scientists often present their sample results as the mean ± SEM.
A medical study examined the effect of a new medication on the
seated systolic blood pressure. The results, presented as mean ±
SEM for 25 patients, are 113.5 ± 8.9. What is the standard
deviation s of the sample data?
SEM = s/√n <=> s = SEM*√n
s = 8.9*√25 = 44.5
Table C
When σ is unknown
we use a t distribution
with “n − 1” degrees
of freedom (df).
Table C shows the
z-values and t-values
corresponding to
landmark P-values/
confidence levels.
x m
t
s n

When σ is known,
we use the Normal
distribution and z.
The one-sample t test
As before, a test of hypotheses requires a few steps:
1. Stating the null hypothesis (H0)
2. Deciding on a one-sided or two-sided alternative (Ha)
3. Choosing a significance level a
4. Calculating t and its degrees of freedom
5. Finding the area under the curve with Table C or software
6. Stating the P-value and concluding
We draw a random sample of size n from an N(µ, σ) population.
When s is estimated from s, the distribution of the test statistic t is a
t distribution with df = n – 1.
H o : m =mo
1
x  m0
t
s n
0
t
This resulting t test is robust to deviations from Normality as long as the
sample size is large enough.
The P-value is the probability, if H0 was true, of randomly drawing a
sample like the one obtained or more extreme in the direction of Ha.
One-sided
(one-tailed)
Two-sided
(two-tailed)
t
x  m0
s
n
Using Table C:
For Ha: μ > μ0
if n = 10 and t = 2.70, then…
2.398 < t 2.7 < 2.821
so
0.02 > P-value > 0.01
Study Participants: 53 obese children ages 9 to 12 with a BMI above
the 95th percentile for age and gender
Intervention: family counseling sessions on the stoplight diet (green/yellow/red
approach to eating food) - after 8 weekly sessions and 3 follow-up sessions
Assessment: Weight change at 15 weeks of intervention
Was the intervention effective in helping obese children lose weight?
H0: m = 0 versus Ha: m < 0 (one-sided test)
Variable
Weightchange
N
53
Mean
-2.404
SE Mean
0.720
StDev
5.243
-16.7
-14.8
-11.9
-9.7
-9.6
-8.8
-8.0
-7.1
-6.6
-6.0
-5.6
-5.6
-5.5
-5.5
-5.1
-5.0
-5.0
-4.8
-4.4
-4.4
-4.1
-4.0
-4.0
-3.6
-3.5
-3.2
-2.8
-2.0
-1.8
-1.8
-1.4
-1.2
-0.2
-0.1
0.0
0.2
0.6
1.0
1.2
1.2
1.4
1.8
2.0
2.2
2.5
2.8
3.3
4.2
5.4
5.8
6.0
6.4
8.4
MINITAB: Test of mu = 0 vs < 0
Variable
N
Mean StDev
Weightchange 53 -2.404 5.243
𝑡=
SE Mean
0.720
T
-3.34
P
0.001
𝑥 − 𝜇0
−2.404 − 0
=
= −3.34
0.720
(𝑠 𝑛)
For df = 52 ≈ 50, 3.261 < |t| = 3.34 < 3.496,  0.001 > one-sided P > 0.0005
(software gives P = 0.0008 ≈ 0.001), highly significant.
There is a significant weight loss, on average, following intervention.
Confidence intervals
A confidence interval is a range of values that contains the true
population parameter with probability (confidence level) C.
We have a set of data from a population with both m and s unknown. We
use x̅ to estimate m, and s to estimate s, using a t distribution (df n − 1).

C is the area between −t* and t*.

We find t* in the line of Table C.

The margin of error m is:
m  t*s
n
C
m
−t*
m
t*
Data on the blood cholesterol levels (mg/dl) of 24 lab rats give a sample mean
of 85 and a standard deviation of 12. We want a 95% confidence interval for
the mean blood cholesterol of all lab rats.
df = 𝑛 − 1 = 24 − 1 = 23
𝑚 = 𝑡 ∗. 𝑠
𝑛 = 2.069 12/ 24 = 5.07
𝑥 ± 𝑚 = 85 ± 5.1, or 79.9 to 90.1 mg/dl
We are 95% confident that the true mean blood cholesterol
of all lab rats is between 79.9 and 90.1 mg/dl.
Matched pairs t procedures
Sometimes we want to compare treatments or conditions at the
individual level. The data sets produced this way are not independent.
The individuals in one sample are related to those in the other sample.

Pre-test and post-test studies look at data collected on the same sample
elements before and after some experiment is performed.

Twin studies often try to sort out the influence of genetic factors by
comparing a variable between sets of twins.

Using people matched for age, sex, and education in social studies
allows us to cancel out the effect of these potential lurking variables.
In these cases, we use the paired data to test for the difference in the
two population means.
The variable studied becomes 𝑋𝑑𝑖𝑓𝑓 : average difference, and
H0: µdiff = 0; Ha: µdiff > 0 (or < 0, or ≠ 0)
Conceptually, this is just like a test for one population mean.
Study Participants: 53 obese children ages 9 to 12 with a BMI above
the 95th percentile for age and gender
Intervention: family counseling sessions on the stoplight diet (green/yellow/red
approach to eating food) - after 8 weekly sessions and 3 follow-up sessions
Assessment: Weight change at 15 weeks of intervention
Was the intervention effective in helping obese children lose weight?
This is a pre-/post design. The weight change
values are the difference in body weight before
and after intervention for each participant.
Variable
Weightchange
N
53
Mean
-2.404
SE Mean
0.720
StDev
5.243
-16.7
-14.8
-11.9
-9.7
-9.6
-8.8
-8.0
-7.1
-6.6
-6.0
-5.6
-5.6
-5.5
-5.5
-5.1
-5.0
-5.0
-4.8
-4.4
-4.4
-4.1
-4.0
-4.0
-3.6
-3.5
-3.2
-2.8
-2.0
-1.8
-1.8
-1.4
-1.2
-0.2
-0.1
0.0
0.2
0.6
1.0
1.2
1.2
1.4
1.8
2.0
2.2
2.5
2.8
3.3
4.2
5.4
5.8
6.0
6.4
8.4
Does lack of caffeine increase depression?
Randomly selected caffeine-dependent individuals were deprived of all caffeinerich foods and assigned to receive daily pills. At one time the pills contained
caffeine and, at another time they were a placebo. Depression was assessed
quantitatively (higher scores represent greater depression).
Depression Depression Placebo Subject with Caffeine with Placebo Caffeine
Cafeine
1
5
16
11
2
5
23
18
3
4
5
1
4
3
7
4
5
8
14
6
6
5
24
19
7
0
6
6
8
0
3
3
9
2
15
13
10
11
12
1
11
1
0
-1
This is a matched pairs design with 2
data points for each subject.
We compute a new variable
“Difference” Placebo minus Caffeine
With 11 "difference" points, df = n – 1 = 10.
We find: x̅diff = 7.36; sdiff = 6.92; so SEMdiff = sdiff / √n = 6.92/√11 = 2.086
We test:
H0: mdiff = 0 ; Ha: mdiff > 0
t
xdiff  mdiff
sdiff
n

xdiff  0
SEM diff
7.36

 3.53
2.086
(…)
For df = 10, 3.169 < t 3.53 < 3.581  0.005 > P-value > 0.0025
(Software gives P = 0.0207.)
Caffeine deprivation causes a significant increase in depression
(P < 0.005, n = 11).
Robustness
The t procedures are exactly correct when the population is exactly
Normal. This is rare.
The t procedures are robust to small deviations from Normality, but:

The sample must be a random sample from the population.

Outliers and skewness strongly influence the mean and therefore the t
procedures. Their impact diminishes as the sample size gets larger
because of the Central Limit Theorem.
As a guideline:



When n < 15, the data must be close to Normal and without outliers.
When 15 > n > 40, mild skewness is acceptable, but not outliers.
When n > 40, the t statistic will be valid even with strong skewness.
Does oligofructose consumption stimulate calcium absorption?
Healthy adolescent males took a pill for nine days and had their calcium
absorption tested on the ninth day. The experiment was repeated three weeks
later. Subjects received either an oligofructose pill first or a control sucrose pill
first. The order was randomized and the experiment was double-blind.
Subject
1
2
3
4
5
6
7
8
9
10
11
xbar
s
Control Oligofructose Difference (O-C)
78.4
62.0
-16.4
76.6
95.1
18.5
57.4
46.5
-10.9
51.5
49.4
-2.1
49.0
89.7
40.7
46.6
43.8
-2.8
44.2
50.3
6.1
42.9
51.6
8.7
37.2
66.6
29.4
34.1
52.7
18.6
24.6
54.0
29.4
49.32
16.51
60.15
17.24
10.84
18.15
Difference in percent intake (O-C)
Fractional calcium absorption data (in percent of intake) for 11 subjects:
40
30
20
10
0
-10
-20
-2
-1
0
Score
1
2
Can we use a t inference procedure for this study? Discuss the assumptions.
Red wine, in moderation
Does drinking red wine in moderation increase blood polyphenol levels,
thus maybe protecting against heart attacks?
Nine randomly selected healthy men were assigned to drink half a bottle of red
wine daily for two weeks. The percent change in their blood polyphenol levels
was assessed:
0.7
3.5
4
4.9
5.5
7
7.4
8.1
8.4
x̅ = 5.5; s = 2.517; df = n − 1 = 8
1.2
2.4
3.6
4.8
6.0
Percent change in blood polyphenol level
7.2
8.4
Can we use a t inference procedure for this study? Discuss the assumptions.