1
$\begingroup$

I know that my 95% confidence interval can be calculated for a proportion using:

$$ 1.96 \times \sqrt{p(\frac{1-p}{n})} $$

where $p$ is the proportion and $n$ is the number of trials.

But if my data is collected in a series of datasets (say, annual data collections), does this change my $n$? For example, if my data is framed:

Year TRUE n
2010 14 25
2011 17 25
2012 15 25
2013 11 25
2014 15 25

Do I calculate a total $p=\frac{14+17+15+11+15}{25\times5}=0.576$ and use:

  1. $n=5$ because data was collected in five seperate experiments? $$ 1.96 \times \sqrt{0.576(\frac{1-0.576}{5})} $$

  2. $n=125$ because data was collected on 125 events? $$ 1.96 \times \sqrt{0.576(\frac{1-0.576}{125})} $$

Furthermore, say there was an extra variable, $x$, for which I wanted to calculate a seperate proportion for ($\frac{\text{TRUE}}{x}$). Say $x$ represents the total number of job openings available and $n$ is the total applications, so $\frac{\text{TRUE}}{n}$ would be the job acceptance rate and $\frac{\text{TRUE}}{x}$ would be the positions filled rate:

Year TRUE n x
2010 14 25 20
2011 17 25 20
2012 15 25 20
2013 11 25 20
2014 15 25 20

Would my $n$ for calculating my confidence interval for $\frac{\text{TRUE}}{x}$ still use the total from the $n$ column (either $5$ or $125$) or would it be the total from the $x$ column (either $5$ or $100$)?

$\endgroup$

1 Answer 1

3
$\begingroup$

The model for this experiment is $$ X_i \sim \mathrm{Bernoulli}(p) $$ where the $X_i$ are the total outcomes of all of the trials. If you had access to the whole data (ie, the outcomes of all 125 trials), your estimate of $p$ would be $$ \hat{p} = \frac{1}{125} \sum_{i=1}^{215} X_i. $$

Fortunately, you can compute this estimate from the data you do have, which id $$ \frac{1}{125} \Bigl( \sum_{i=1}^{25} X_i + \sum_{i=26}^{50} X_i + \dotsc + \sum_{i=101}^{125} X_i \Bigr), $$ where each of these sums are the total yearly outcomes that you have access to.

Now, by the central limit theorem, $\hat{p}$ has an approximate distribution of $$ \hat{p} \stackrel{\mathrm{d}}{\approx}N\Bigl(p, \frac{p(1-p)}{\sqrt{125}}\Bigl), $$ from which we have the standard error estimate $$ \mathrm{se}(\hat{p}) = \frac{\hat{p}(1-\hat{p})}{\sqrt{125}}, $$ and so the confidence interval $$ \hat{p} \pm 1.96 \cdot \frac{\hat{p}(1-\hat{p})}{\sqrt{125}}. $$

The point here is that $n$ is the total number of independent trials, of which you have $125$. If your data were the outcomes of the $125$ trials, you probably wouldn't be confused, and would confidently use $125$ as your $n$ value.

Well, it turns out that, even though you don't have access to the whole data, you still have all of the information that you need to compute this some $\hat{p}$, so the situation is the same!

$\endgroup$
1
  • $\begingroup$ Thank you so much! That answers the first question very well. Any insight to the additional question? $\endgroup$ Commented Mar 3, 2023 at 6:44

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.