# Calculating 95% confidence interval for survey results

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

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]$$.