How do I calculate this sampling error?

323 Views Asked by At

If I sample individual integer values $0$ to $100$ from a distribution $100000$ times and record the counts for all integer values between $0$ and $100$, how do I calculate the $95$% error bars for the probability of my next sample being equal to a certain value? If I sample $100000$ times again, the probabilities I calculate will likely be different to my initial calculations; how do I account for this?

1

There are 1 best solutions below

9
On

Suppose you pick the value $43$. You got that value a certain number of times $x$ in $100000$ draws, for a proportion or probability $p = \frac{x}{100000}$. If you are only interested in the value $43$, we can essentially divide the whole situation into a binary choice: $43$ or not $43$.

If I read your question right, you are asking for the error in that proportion. The standard error of a sample proportion is $\sqrt{\frac{pq}{n}}$ where $q = 1-p$. Your sample size is large, and assuming $x$ is also large, then you can approximate the distribution of probability of getting $43$ as a normal distribution. So your $95$% confidence interval would be $\frac{x}{100000} \pm 1.96 \sqrt{\frac{pq}{100000}}$