Mo Durran
Mo Durran

Reputation: 1

confidence interval for population proportion in R

How to calculate 95% confidence interval of a nominal variable. For instance, I have a sample size of 987 (300 smokers, 687 non-smokers). I need to calculate 95% confidence interval for the percentage of smokers in the population.

Upvotes: 0

Views: 1317

Answers (1)

Todd T
Todd T

Reputation: 56

Do read the Wikipedia link provided by Otto. An easy to use implementation in R can be found in the Hmisc package.

library(Hmisc)
binconf(687, 987,alpha = 0.05)

Upvotes: 1

Related Questions