1
$\begingroup$

As an example, my problem is something similar to this: Lets say that you open 10 chests and each chest has a 30% chance of having an item. Calculate the confidence interval for the number of items found. 95% confidence, use Student t distribution if possible.

I was using the formula $s(p) = \sqrt{p(1-p)}$ for estimating the standard error of the probability p and the Student t distribution for the confidence interval.

The number of items found is I=n*p; where n is the number of chests opened (n=10) and p is the probability of the chest having an item (p=0.3).

I would need something like: if I open 10 chests, there's a 95% probability that the number of items found is between 2 and 7.

$\endgroup$

1 Answer 1

2
$\begingroup$

You only need the variance of $\hat p$ if that is your target of inference, in this case you know the proportion and want to predict the number of 'successes' $X$ instead. You can draw this directly from the binomial point mass function, which looks like this for $n=10$ and $p=0.3$:

binomial PMF

You can get the 95% central density of this distribution as its $(0.025, 0.975)$ quantiles, which in this case is $(0, 6)$. As an aside, even for inference on $p$ the normal approximation with which you started is almost always the worst option (its main advantage being ease of computation), especially for such small sample sizes.

I used the following R code to get to these numbers:

n <- 10
p <- 0.3

pmf <- dbinom(0:n, n, p)
ci <- qbinom(c(.025, .975), n, p)
> [1] 0 6
$\endgroup$
1
  • $\begingroup$ Thank you so much for your answer. I'll take that into account. $\endgroup$ Commented Dec 31, 2023 at 9:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.