[1] 1.644854
We build the CI around the sample proportion.
Assume
\[ \hat{p} \sim N(p,se) \]
We’ll need \(\hat{p}\) and \(\text{se}= \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}\)
We also need the z score that goes with the confidence interval we are looking for.
\(\hat{p} \pm z_{score} \times se\)
CI | Z-score |
---|---|
90% | \(z_{0.05}=1.645\) |
95% | \(z_{0.025}=1.96\) |
99.7% | \(z_{0.005}=2.968\) |
qnorm()
qnorm()
finds the quantile that goes with a pvalue (probability)
[1] 1.644854
pnorm()
finds a pvalue from a quantile.
[1] 0.975
Calculate these: \(\hat{p}\) and \(\text{se}= \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}\)
\(\hat{p} \pm z_{score} \times se\)
Independent and “large” sample.
Success-Failure Condition
Why do we need to assume this:
\[ \hat{p} \sim N(p,se) \]
\[ \hat{p} \sim N(p,SE)\]
With \(SE= \sqrt{\frac{p(1-p)}{n}}\)
or
\(SE= \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}\)
The operations need to be independent.
n should be large
Success-Failure Condition
\(np >=10\) and
\(n(1-p) >= 10\)
We ask 1042 New Yorkers if they are for quarantining people who have been exposed to ebola. The results are below.
# A tibble: 2 × 2
quarantine n
<fct> <int>
1 against 188
2 favor 854
Write the notation for the theoretical sampling distribution.
Make a 90, 95 and 99.7% CI for those against and interpret.
What is the proportion of college students that have had more than 1 exclusive_relationships
?
# A tibble: 3 × 2
`num > 1` n
<lgl> <int>
1 FALSE 51
2 TRUE 152
3 NA 15
Check Conditions.
Write the notation for the theoretical sampling distribution.
Make a 90, 95 and 99.7% CI for those against and interpret.
Every week the Yougov/The Economist do a survey from a representative sample of about 1500 adults. methodology On March 4, 2024 people were asked about their personal finances. See the results here.
42% of respondants said they were worse off than a year ago. Find a CI for the true proportion of Americans who feel they are worse off financially than a year ago.