Class 08 - University of Virginia

Download Report

Transcript Class 08 - University of Virginia

Class 08
Two-tailed Tests
Testing a population p
EMBS 9.1
EMBS 9.5
Measurement Scale Matters
• The Roulette wheel outcomes are categorical.
– Start with the 904 outcomes, and create a 38-cell
table of summary counts.
• Treat the Birth Month outcomes are categorical
(J,F,M,….D) ?
– Create a 12-cell table of summary counts.
• Lorex fill outcomes are NUMERICAL.
– Calculate descriptive summary statistics.
– If desired, create your own bins and get a table of
summary counts (histogram).
MythBusters Mini-Myth
play
Classical Statistics
1.
2.
Develop and state H0 and Ha.
Specify the level of significance
1.
3.
10 paired cups, double blind
Test statistic is number of correct
Calculate the p-value: the probability of observing a test statistic
as “extreme” as the one calculated if H0 is true.
1.
2.
3.
5.
α=0.05 is most common
Identify the test statistic, design and run the experiment, calculate
the test statistic
1.
2.
4.
EMBS p 367
P(#correct ≥ 8 given she’s guessing) = .055
P(#correct ≥ 9 given she’s guessing) = .011
P(10 correct given she’s guessing) = .001
Reject H0 if p-value is ≤ α
1. Formulate Hypothesis
H0:
HA:
2. Specify the level of Significance
α=
3. Identify the Test Statistic
4. Calculate the p-value: the probability of
observing a test statistic as “extreme” as the one
calculated if H0 is true.
5. Reject H0 if p-value is ≤ α
Two-Tailed Ha
• If you are looking for differences in EITHER
direction
– Butter affects how the toast comes down
– The Lady Tasting tea can distinguish…. but not
necessarily identify which is which.
• The chi-squared GOF test is ALWAYS a 2-tailed
test.
– Differences between E and O in either direction
contribute to a larger calculated chi-squared statistics
Let’s Do Wunderdog as 2-tailed.
• H0: He is guessing (p=.5, independent events)
• Ha: He is not (p ≠.5)
• Test statistic: Number correct = 87.
• P( X≥87 or X≤ 62│H0 ) = 1-normdist(87,74.5,6.06,true) +
normdist(62,74.5,6.06,true)
= 0.020 + 0.020 = 0.04
• Conclusion: Still statistically significant at the
α=0.05 level.
It can be confusing
• If we are more specific about what we are
looking for (Ha: p>0.5), then the pvalue will be
lower.
– And a result is more likely to meet the 0.05
standard.
• If we can’t be as specific (Ha: p≠0.5), then the
pvalue will be higher.
– And a result is less likely to meet the 0.05
standard.
In these kinds of problems instead
of using X=number correct as the
Sample mean
test statistic….. The(average)
of the
The Sample
proportion
column of 149 0’s
and 1’s.
…we can also use 𝑝 = X/n as the
test statistic.
If X is N(n*p,[n*p*(1-p)]1/2)
= X/n is N(p,
𝑝 ∗ (1 − 𝑝)
𝑛
1/2
)
We can either compare the 87 correct to the 74.5 expected number correct
Or…compare the 87/149 = 0.584 sample proportion correct to 0.5.
WE JUST HAVE TO USE THE CORRECT STANDARD DEVIATION.
P(60 or more in 100 if guessing)
=1-BINOMDIST(59,100,.5,true) = 0.028
68% chance number correct
will be within +/- 5 of 50
[100*.5*.5]^.5
=1-NORMDIST(60,50,5,true) = 0.023
68% chance sample propotion
will be within +/- .05 of 0.50
[(.5*.5)/100]^.5
=1-NORMDIST(0.6,.5,.05,true) = 0.023
The Standard Deviation of a sample
proportion given p
It is highest at
p=.5
If p is 0 or 1, it
is zero
𝑝 ∗ (1 − 𝑝)
𝑛
It gets smaller
as n gets
bigger.
Requires
Independent
Outcomes
It is the square root
of n that matters. 4x
the sample size, cuts
it in half.
The Standard Deviation of a sample
proportion given p
+/- 1 *
𝑝 ∗ (1 − 𝑝)
𝑛
+/- 2 *
𝑝 ∗ (1 − 𝑝)
𝑛
+/-
1
𝑛
68%
95%
95% if p=0.5
Pollsters call this the margin of error