An R Introduction to Statistics

Point Estimate of Population Proportion

Multiple choice questionnaires in a survey are often used to determine the the proportion of a population with certain characteristic. For example, we can estimate the proportion of female students in the university based on the result in the sample data set survey.

Problem

Find a point estimate of the female student proportion from survey.

Solution

We first filter out missing values in survey$Sex with the na.omit function, and save it in gender.response.

> library(MASS)                  # load the MASS package 
> gender.response = na.omit(survey$Sex) 
> n = length(gender.response)    # valid responses count

To find out the number of female students, we compare gender.response with the factor ’Female’, and compute the sum. Dividing it by n gives the female student proportion in the sample survey.

> k = sum(gender.response == "Female") 
> pbar = k/n; pbar 
[1] 0.5

Answer

The point estimate of the female student proportion in survey is 50%.