Lecture 6 Outline: Tue, Sept 23

Download Report

Transcript Lecture 6 Outline: Tue, Sept 23

Lecture 6 Outline: Tue, Sept 23
• Review chapter 2.2
– Confidence Intervals
• Chapter 2.3
– Case Study 2.1.1
– Two sample t-test
– Confidence Intervals
• Testing for equal variances (Chapter 4.5.3)
Notes on Homework
• #1. Finding quartiles:
– The stem and leaf plot provides an ordered list of the
observations in increasing order
– The first quartile is the median of the observations
whose position in the ordered list is to the left (to the
top in stem-and-leaf plot) of the overall median
– The third quartile is the median of the observations
whose position in the ordered list is to the right (to the
bottom in stem-and-leaf plot) of the overall median.
• #3. Unemployment Spells.
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=|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.
One-sided tests
• One-sided alternatives: H1:   0 , H1:   0 , Twosided alternative: H1:   0
• Choice of one-sided or two-sided depends on how
specifically the researcher can pinpoint the
alternative.
• Always report whether p-value is one-or-twosided.
• One-sided test: H1:   0
Y 0
t
s/ n
– Test statistic:
– For schizophrenia example, t=3.21, p-value (1-sided)
=.003
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
Confidence Interval for

• A confidence interval is a range of “plausible
values” for a statistical parameter (e.g., the
population mean) based on the data. It conveys
the precision of the sample mean as an estimate of
the population mean.
• 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.
CI for population mean
• If the population distribution of Y is normal
(* we will study the if part later) 95% CI for
mean of single population:
Y  tn1 (.975) * SE(Y ) 
s
Y  tn1 (.975) *
n
• For schizophrenia data:
.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.
• The accuracy of the confidence interval is only guaranteed
if the probability model is correct – if the data is collected
haphazardly rather than through random sampling, the
confidence interval is not reliable
Matched Pairs 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.
• 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.
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(Y2  Y1 )  

n1 n2
1 1
SE (Y2  Y1 )  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
Y2  Y1
2
Two sample t-test
• H0:2  1   *, H1: 2  1   *
• Test statistic: T= | t | | (Y2  Y1 )   * |
SE(Y2  Y1 )
• 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
One-sided p-values
• If H1:
is
• If
is
2  1   *, test statistic
(Y  Y )   *
T t  2 1
SE(Y2  Y1 )
H1: 2  1   * , test statistic
(Y2  Y1 )   *
T  t  
SE(Y2  Y1 )
p-value is probability that T would be >=
observed T0 if H0 is true
Confidence Interval for 
• 100(1- )% confidence interval for
2
 1
2  1 :
(Y2  Y1)  tdf (1   / 2)SE(Y2  Y1)
confidence interval, tdf (.975)  2
• For 95%
• Factors affecting width of confidence
interval:
– Sample size
– Population standard deviation 
– Level of confidence (1   )
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
• To see the means and standard deviations
themselves, click on Means and Std Dev
under red triangle
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.