Lecture 6 Outline – Thur. Jan. 29

Download Report

Transcript Lecture 6 Outline – Thur. Jan. 29

Lecture 6 Outline – Thur. Jan. 29
•
•
•
•
•
Review from Lecture 5
Sampling with vs. without replacement
Confidence Intervals
Case Study 2.1.1
Two sample t-test and confidence intervals
(Chapter 2.3)
• Levene’s test for equality of variances
(Chapter 4.5.3)
Terminology Review
• A statistic is any quantity computed from the
sample, e.g., sample mean, sample standard
deviation, minimum of sample.
• The sampling distribution of a statistic for a
sample of size n is the probability distribution for
the statistic over repeated random samples of size
n.
• The sampling distribution of the value for a
sample of size 1 is called the population
distribution.
Standard Deviations and
Standard Errors
• The standard deviation of a statistic is the standard
deviation of the statistic’s probability distribution,
i.e., the square root of the average squared
distance of the statistic from its mean over
repeated samples.
• The standard error of a statistic is an estimate of
the statistics’ standard deviation.
• Example: For sampling with replacement,

s
SD(Y ) 
, SE(Y ) 
n
n
Sampling with vs. without
replacement
• For a sample of size n from a population of size N
without replacement,

N n
s
N n
SD(Y ) 

, SE(Y ) 

N 1
N 1
n
n
• The factor N  n is called the finite population
N 1
correction (FPC).
• Note that the FPC is near 1 if N/n>50 so that we
regard sampling with replacement and sampling
without replacement as essentially equivalent if
N/n>50.
One-sample t-tools and paired t-test
• Testing hypotheses about the mean
difference in pairs is equivalent to testing
hypotheses about the mean of a single
population
• Probability model: Simple random sample
with replacement from population.
• H0 :   *,H1 :    *
• Test statistic: t  Y   *  Y   *
SE(Y )
s/ n
p-value
• Fact: If H0 is true, then t has the Student’s t-distribution
with n-1 degrees of freedom
• Can look up quantiles of t-distribution in Table A.2.
• The (2-sided) p-value is the proportion of random samples
with absolute value of t >= observed test statistic |to| if H0
is true.
• Schizophrenia example: to=3.23, p-value = Prob>|t| =
.0061.
• The reliability of the p-value (as the probability of
observing as extreme a test statistic as the one actually
observed if H0 is true) is only guaranteed if the probability
model of random sampling is correct – if the data is
collected haphazardly rather than through random
sampling, the p-value is not reliable.
p-value animation
8
7
Estim Mean0.1986666667
Hypoth Mean0
T Ratio 3.2289280811
P Value 0.0060615436
6
Y
5
4
3
2
1
0
-0.4
-0.3
Sample Size = 15
-0.2
-0.1
.0
X
.1
.2
.3
.4
Matched pairs t-test in JMP
• Click Analyze, Matched Pairs, put two
columns (e.g., affected and unaffected) into
Y, Paired Response.
• Can also use one-sample t-test. Click
Analyze, Distribution, put difference into Y,
columns. Then click red triangle under
difference and click test mean.
Confidence Intervals
• Point estimate: a single number used as the best estimate of
a population parameter, e.g., Y for .
• Interval estimate (confidence interval): range of values
used as an estimate of a population parameter.
• Uses of a confidence interval:
– Provides a range of values that is “likely” to contain the
true parameter. Confidence interval can be thought of
as the range of values for the parameter that are
“plausible” given the data.
– Conveys precision of point estimate as an estimate of
population parameter.
Confidence interval construction
• A confidence interval typically takes the form:
point estimate  margin of error
• The margin of error depends on two factors:
– Standard error of the estimate
– Degree of “confidence” we want.
– Margin of error = Multiplier for degree of confidence *
SE of estimate
– For a 95% confidence interval, the multiplier for degree
of confidence is about 2 in most cases.
CI for population mean
• If the population distribution of Y is normal
and the sample is a random sample, 100(1   )%
CI for mean of single population:
Y  tn1 (1   / 2) * SE(Y ) 
s
Y  tn1 (1   / 2) *
n
• For schizophrenia data, 95% CI:
.199cm3  2.145 0.615cm3 
0.067cm3 to 0.331cm3
Interpretation of CIs
• A 95% confidence interval will contain the true
parameter (e.g., the population mean) 95% of the
time if repeated random samples are taken.
• It is impossible to say whether it is successful or
not in any particular case, i.e., we know that the CI
will usually contain the true mean under random
sampling but we do not know for the
schizophrenia data if the CI (0.067cm3 ,0.331cm3)
contains the true mean difference.
• Confidence interval will only have guaranteed
coverage if the assumptions about the probability
model are correct, in particular the sample must be
a random sample.
Confidence Intervals in JMP
• For both methods of doing paired t-test
(Analyze, Matched Pairs or Analyze,
Distribution), the 95% confidence intervals
for the mean are shown on the output.
Factors determining width of
confidence interval
• 100(1   )% confidence interval for  under
random sampling with replacement from a normal
population:Y  tn1 (1   / 2) * SE(Y ) 
s
Y  tn1 (1   / 2) *
n
• Factors determining width of confidence interval:
– Population standard deviation 
– Sample size n
– Degree of confidence 1  
Case Study 2.1.1
• Background: During a severe winter storm in New
England, 59 English sparrows were found freezing
and brought to Bumpus’ laboratory – 24 died and
35 survived.
• Broad question: Did those that perish do so
because they lacked physical characteristics
enabling them to withstand the intensity of this
episode of selective elimination?
• Specific questions: Do humerus (arm bone)
lengths tend to be different for survivors than for
those that perished? If so, how large is the
difference?
Structure of Data
• Two independent samples
• Observational study – cannot infer a causal
relationship between humerus length and survival
• Sparrows were not collected randomly.
• Fictitious probability model: Independent simple
random samples with replacement from two
populations (sparrows that died and sparrows that
survived). See Display 2.7
Two-sample t-test
Population parameters: 1,1, 2 , 2
H0: 1  2  0 , H1: 1  2  0
Equal spread model: 1   2 (call it  )
Statistics from samples of size n1 and n2
2
2
from pops. 1 and 2: Y1,Y2 , s1 , s2
• For Bumpus’ data:
•
•
•
•
Y1  .728,Y2  .738,Y2  Y1  .010, s1  .024, s2  .020
Sampling Distribution of
•
•
1 1
SD(Y1  Y2 )  

n1 n2
1 1
SE (Y1  Y2 )  s p

n1 n2
• Pooled estimate of
(equal spread model)
2
:
(n1  1)s1  (n2  1)s2
2
sp 
(n1  1)  (n2  1)
2
See Display 2.8
Y1  Y2
2
Confidence Interval for   
1
• Assume the population distributions of group 1
and group 2 are both normal.
• 100(1- )% confidence interval for 1  2 :
(Y1  Y2 )  tdf (1   / 2) * SE(Y1  Y2 ) 
(Y1  Y2 )  tn1 n2 2 (1   / 2) * s p
1 1

n1 n2
• For 95% confidence interval, t (.975)  2
df
• Bumpus’ data: 95% confidence interval:
 0.01008 2.009* 0.00567 (0.02143,0.00127)inches
2
Two sample t-test
• H0:1  2   *, H1: 1  2   *
• Test statistic: t  (Y1  Y2 )   * . Values of t that are farther
SE(Y1  Y2 )
from zero are more implausible under H0
• If population distributions are normal with equal  , then if
H0 is true, the test statistic t has a Student’s t distribution
with n1  n2  2 degrees of freedom.
• p-value equals probability that |t| would be greater than
observed |t| under random sampling model if H0 is true;
calculated from Student’s t distribution.
• For Bumpus data, two-sided p-value = .0809, suggestive
but inconclusive evidence of a difference
Two sample tests and CIs in JMP
• Click on Analyze, Fit Y by X, put Group variable
in X and response variable in Y, and click OK
• Click on red triangle next to Oneway Analysis and
click Means/ANOVA/t-test
(Means/ANOVA/pooled t in JMP version 5).
• To see the means and standard deviations
themselves, click on Means and Std Dev under red
triangle
Oneway Analysis of Humerus By Group
0.8
0.78
Humerus
0.76
0.74
0.72
0.7
0.68
0.66
0.64
Perished
Survived
Group
t Test
Perished-Survived
Assuming equal variances
Difference
Std Err Dif
Upper CL Dif
Lower CL Dif
Confidence
-0.020
-0.010
-0.01008
0.00567
0.00128
-0.02145
0.95
t Ratio
DF
Prob > |t|
Prob > t
Prob < t
.000 .005.010 .015
-1.777
57
0.0809
0.9595
0.0405
Bumpus’ Data Revisited
• Bumpus concluded that sparrows were subjected to
stabilizing selection – birds that were markedly different
from the average were more likely to have died.
• Bumpus (1898): “The process of selective elimination is
most severe with extremely variable individuals, no matter
in what direction the variations may occur. It is quite as
dangerous to be conspicuously above a certain standard of
organic excellence as it is to be conspicuously below the
standard. It is the type that nature favors.”
• Bumpus’ hypothesis is that the variance of physical
characteristics in the survivor group should be smaller than
the variance in the perished group
Testing Equal Variances
• Two independent samples from populations with
variances  12 and  2 2
• H0:  2   2 vs. H1:  2   22
1
1
2
• Levene’s Test – Section 4.5.3
• In JMP, Fit Y by X, under red triangle next to
Oneway Analysis of humerus by group, click
Unequal Variances. Use Levene’s test.
• p-value = .4548, no evidence that variances are not
equal, thus no evidence for Bumpus’ hypothesis.