Given a Bernoulli distribution with a success probability of p = 0.02. Let's say we have N=3000 samples. How can I compute a confidence intervals for the expected number of successes (e.g., with 5% significance level)?
Asked
Active
Viewed 1,543 times
1 Answers
4
Your expected value is $3000\times0.02=60$, the variance is $3000\times 0.02\times(1-0.02)=58.8$. Simulating 100,000 trials and plotting a histogram, I would say you can use the normal approximation unless you have very strong requirements on accuracy (in which case the R help page says that "qbinom() uses the Cornish-Fisher Expansion to include a skewness correction to a normal approximation, followed by a search", which may help).
nn <- 3000
n.sim <- 100000
foo <- rbinom(n=n.sim,size=nn,prob=.02)
hist(foo,breaks=seq(min(foo)-.5,max(foo)+.5,by=1))

Stephan Kolassa
- 123,354
pbinom()tells me that you should expect 50 or fewer hits on about 10.5% of all days. Nothing to really pester you with questions about... – Stephan Kolassa Jan 28 '13 at 19:40