I'm wondering if someone could let me know if I have calculated the confidence interval for the difference between two proportions correctly.
The sample size is 34, of which 19 are females and 15 are males. Therefore, the difference in proportions is 0.1176471.
I calculate the 95% confidence interval for the difference to be between -0.1183872 and 0.3536814. As the confidence interval passes through zero, the difference is not statistically significant.
Below are my workings out in R, with results as comments:
f <- 19/34 # 0.5588235 m <- 15/34 # 0.4411765 n <- 34 # 34 difference <- f-m # 0.1176471 lower <- difference-1.96*sqrt((f*(1-f))/n+(m*(1-m))/n) # -0.1183872 upper <- difference+1.96*sqrt((f*(1-f))/n+(m*(1-m))/n) # 0.3536814