8.9 CPS85 dataset and linear regression

  • The CPS85 dataset from the mosaicData package, contains 1985 data on wages and other characteristics of workers.

  • Using the CPS85 data let’s predict the log-odds of being married, given one’s sex, age, race and job sector.

# fit logistic model for predicting
# marital status: married/single
data(CPS85, package = "mosaicData")
cps85_glm <- glm(married ~ sex + age + race + sector, 
                 family="binomial", 
                 data=CPS85)