We are interested in estimating the proportion of students at a university who smoke. Out of a random sample of 200 students from this university, 40 students smoke.
10/16/2019
We are interested in estimating the proportion of students at a university who smoke. Out of a random sample of 200 students from this university, 40 students smoke.
Formula I used: \[SE=\sqrt{p(1-p)/n}\]
n <- 200 ; p <- 40/200 se <- sqrt((p*(1-p))/n) z <- 1.96 me <- z * se LO <- round(p - me, 3) HI <- round(p + me, 3) HI ; LO
## [1] 0.255
## [1] 0.145
We are 95% confident that between 14.5% and 25.5% of students smokes in this university.
\[np >=10\]
\[n(1-p)>=10\]
p <- 40/200 z <- 1.96 me <- 0.02 se <- me/z n <- round(p * (1-p) / se^2) n
## [1] 1537
Formula I used:
\[SE=\sqrt{p(1-p)/n}\]
To have margin of error no later than 2% at a 95% confidence interval for the proportion of students who smoke, you have to have a sample size of 1537.