stat 31, section 1, last time t distribution –for unknown, replace with –compute with tdist...
TRANSCRIPT
Stat 31, Section 1, Last Time
• T distribution– For unknown , replace with
– Compute with TDIST & TINV (different!)
• Paired Samples– Similar to above, work with differences
• Inference for Proportions– Counts & Proportions
– CIs: Best Guess & Conservative
s
Inference for proportionsCase 2: Choice of Sample Size:
Idea: Given the margin of error ,
find sample size to make:
i.e. Dist’n i.e. Dist’n
0.95 0.975
m
mppP ˆ95.0
m
m
n
m
pp ˆ
npp
N1
,0
Sample Size for Proportions
i.e. find so that
i.e.
Problem: in both cases, can’t “get at”
Solution: Standardize,
i.e. put on N(0,1) scale
n )
1,0,(975.0
npp
mNORMDIST
npp
NORMINVm1
,0,975.0
n
Inference for proportionsI.e. Find so that
N(0,1) dist’n
0.975
npp
m1
npp
m
npppp
PmppP11
ˆˆ95.0
n
npp
mZP
1
Sample Size for Proportions
i.e. find so that:
Now solve to get:
Problem: don’t know
n )1,0,975.0(1
NORMINV
npp
m
m
ppNORMINVn
11,0,975.0
p
ppm
NORMINVn
1
1,0,975.02
Sample Size for Proportions
Solution 1: Best Guess
Use from:
– Earlier Study
– Previous Experience
– Prior Idea
p̂
Sample Size for Proportions
Solution 2: Conservative
Recall
So “safe” to use:
4
11max1,0
ppp
411,0,975.0
2
mNORMINV
n
Sample Size for ProportionsE.g. Old textbook problem 8.14 (now 8.16)
An opinion poll found that 44% of adults agree that parents should be given vouchers for education at a school of their choice. The result was based on a small sample. How large an SRS is required to obtain a margin of error of +- 0.03, in a 95% CI?
Sample Size for Proportions
E.g. Old textbook problem 8.14 (now 8.16)
See Class Example 26, Part 2:
https://www.unc.edu/~marron/UNCstat31-2005/Stat31Eg26.xls
Sample Size for Proportions
Note: conservative version not much
bigger, since 0.44 ~ 0.5 so
gap is small
0.44 0.5
Sample Size for Proportions
HW: 8.23, 8.25, give both “best
guess” and “conservative” answers
Hypo. Tests for Proportions
Case 3: Hypothesis Testing
General Setup: Given Value
pH :0
pH :0
Hypo. Tests for Proportions
Assess strength of evidence by:
P-value = P{what saw or m.c. | B’dry} =
= P{observed or m.c. | p = }
Problem: sd of npp
p 1
ˆ
p̂
Hypo. Tests for Proportions
Problem: sd of
Solution: (different from above “best guess”
and “conservative”)
calculation is done base on:
npp
p 1
ˆ
p
Hypo. Tests for Proportionse.g. Old Text Problem 8.16 (now 8.18)Of 500 respondents in a Christmas tree
marketing survey, 44% had no children at home and 56% had at least one child at home. The corresponding figures from the most recent census are 48% with no children, and 52% with at least one. Test the null hypothesis that the telephone survey has a probability of selecting a household with no children that is equal to the value of the last census. Give a Z-statistic and P-value.
Hypo. Tests for Proportions
e.g. Old Text Problem 8.16 (now 8.18)
Let p = % with no child
(worth writing down)48.0:0 pH
48.0: pH A
Hypo. Tests for Proportions
Observed , from
P-value =
44.0ˆ2 pP
48.0|04.0ˆ pppP
48.0|..44.0ˆ pcmorpP
500n44.0ˆ p
Hypo. Tests for ProportionsP-value
= 2 * NORMDIST(0.44,0.48,sqrt(0.48*(1-0.48)/500),true)
See Class Example 26, Part 3https://www.unc.edu/~marron/UNCstat31-2005/Stat31Eg26.xls
= 0.0734
Yes-No: no strong evidence
Gray-level: somewhat strong evidence
44.0ˆ2 pP
Hypo. Tests for ProportionsZ-score version:
P-value =
So Z-score is: =
1.79
04.0ˆ ppP
50048.0148.0
4.01ˆ
npppp
P
Hypo. Tests for ProportionsNote also 1-sided version:
Yes-no: is strong evidence
Gray Level: stronger evidence
HW: 8.19, 8.21, interpret from both
yes-no and gray-level viewpoints
And now for somethingcompletely different….
Another fun movie
Thanks to Trent Williamson
Chapter 9: Two-Way TablesMain idea:
Divide up populations in two ways– E.g. 1: Age & Sex– E.g. 2: Education & Income
• Typical Major Question:
How do divisions relate?
• Are the divisions independent?– Similar idea to indepe’nce in prob. Theory– Statistical Inference?
Two-Way TablesClass Example 40, Textbook Problem 9.20Market Researchers know that background
music can influence mood and purchasing behavior. A supermarket compared three treatments: No music, French accordion music and Italian string music. Under each condition, the researchers recorded the numbers of bottles of French, Italian and other wine purshased.
Two-Way TablesClass Example 40, Textbook Problem 9.20Here is the two way table that summarizes
the data:
Are the type of wine purchased, and the background music related?
Music
Wine: None French Italian
French 30 39 30
Italian 11 1 43
Other 43 35 35
Two-Way TablesClass Example 40: Visualization
Shows how counts are broken down by:
music type wine type
NoneFrench
Italian
French Wine
Italian Wine
Other Wine
0
5
10
15
20
25
30
35
40
45
# Bottles purchased
Music
Class Example 40 - Counts
Two-Way TablesBig Question:Is there a
relationship?
Note: tallest bars French Wine French Music Italian Wine Italian Music Other Wine No MusicSuggests there is a relationship
NoneFrench
Italian
French Wine
Italian Wine
Other Wine
0
5
10
15
20
25
30
35
40
45
# Bottles purchased
Music
Class Example 40 - Counts
Two-Way TablesGeneral Directions:
• Can we make this precise?
• Could it happen just by chance?
– Really: how likely to be a chance effect?
• Or is it statistically significant?
– I.e. music and wine purchase are related?
Two-Way TablesClass Example 40, a look under the hood…Excel Analysis, Part 1:
https://www.unc.edu/~marron/UNCstat31-2005/Stat31Eg40.xls
Notes:• Read data from file• Only appeared as column• Had to re-arrange• Better way to do this???• Made graphic with chart wizard
Two-Way TablesHW: Make 2-way bar graphs, and discuss
relationships between the divisions, for
the data in:
9.1 (younger people tend to be better
educated)
9.13 (you try these…)
9.15
Two-Way TablesAn alternate view:
Replace counts by proportions (or %-ages)
Class Example 40 (Wine & Music), Part 2https://www.unc.edu/~marron/UNCstat31-2005/Stat31Eg40.xls
Advantage:
May be more interpretable
Drawback:
No real difference (just rescaled)