0
$\begingroup$

I have two columns, column one shows the number of people who reported eating 5 fruits a day, column two shows the number of people who reported eating 5 fruits a day after the second test. Both these values are from a random sample of the population.

I would like to return both the rate of people who started eating 5 fruits a day between test 1 and test 2 and the confidence interval. I always assumed calculating the CI requires the mean and standard deviation, but not sure what the mean would be in the scenario

Here is a sample of my data

test1       test2
no           yes
no           yes   
no            no 
yes          yes 
yes          yes
no            no
yes          yes
no            no
yes          yes
no            no
no            no
no            no

I would

$\endgroup$

1 Answer 1

0
$\begingroup$

I am not very sure what exactly is asked in this scenario, but I assume you want to know how confidence interval can be calculated in such a scenario. You first take the binary (yes/no) data for each sample (row in your table) to be "yes" if that person started taking 5 fruits after test 1 (that is, had "no" in first column and "yes" in second) and "no" otherwise.

Now simply, you just need to find the proportion of 'yes'-es, which try to estimate the proportion of 'yes'-es in the population for which you can have a confidence interval. If $p$ is the proportion of 'yes'-es in the population, you can calculate $\hat p = \text{number of 'yes'-es}/\text{total samples}$ from your sample to estimate $p$ and calculate a confidence interval for that estimation $[\hat p - \epsilon, \hat p + \epsilon]$.

Have a look at this link here and the wikipedia page.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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