Section 5.1 Size of Samples (Categorical)
Subsection 5.1.1 Finding the Size of a Sample
Exploration 5.1.1. Course Modality.
A professor is deciding whether to offer a course face-to-face, or online, and wishes to find a 99% confidence interval for the proportion of students who would prefer it to be online.
Recall that the pieces neccesary to compute a 99% confidence interval are:
(a)
Which one of the follwing factors is directly under the professors control?
(b)
Suppose they let
The 99% Confidence Interval.
Remark 5.1.1.
We note that the interval we found Exploration 5.1.1 is quite wide! If the professor wanted to narrow it down, the only thing under their control is how many students they survey.
Definition 5.1.2.
Given a confidence interval
For proportion intervals, this can be computed:
Activity 5.1.2. Course Modality revisted.
Suppose the Professor from Exploration 5.1.1 wanted to conduct a new survey and this time, he wants the margin of error to be less than 5%.
(a)
Find the margin of error for the interval found in Exploration 5.1.1.
(b)
The Professor is still reasonably sure that
Use this value for
(c)
Whats the minimum number of students the professor needs to survey to get a 99% confidence interval with margin of error less than 5%? (This needs to be a whole number.)
Activity 5.1.3. Minimum with no Info.
In Activity 5.1.2 we were able to find the minimum number of students needed to be surveyed to find a 99% confidence interval with 5% margin of error. We did this using an existing estimate for
(a)
Note that the margin of error
Consider this graph of
Activity 5.1.4. Curing Zombification.
In the zombie apocalypse, a geneticist belives she has found a prototype cure for zombification. However, she knows the effectiveness rate is not 100%, otherwise, she's really not sure what it is. She wants to find
Suppose she wanted to find a 95% confidence interval for her cure with margin of error at most 2%. Naturally securing zombies safely is a dangerous endeavor, so she would like to find the smallest possible number of zombies she would need to do this.
(a)
Find the
(b)
Following Activity 5.1.3 let
(c)
What is the smallest number of zombies which must be captured and tested to achieve a 95% confidence interval with 2% margin of error? (A whole number)
(d)
Fix and run the following code to see how many of the n
you captured are cured:
xxxxxxxxxx
n=FIXME
p=runif(1,0.6,0.99)
samp_zombie=sample(c("CURED", "nope"), n, replace=TRUE, prob=c(p, 1-p))
length(which(samp_zombie=="CURED"))
(e)
Using this sample, compute a 95% confidence interval for the proportion of zombies cured by this prototype. Is the margin of error less than 2%?
(f)
Repeat this activity, but for a 99% confidence interval instead.