soss {childfree}R Documentation

Read and recode Michigan State of the State (SOSS) data

Description

Read and recode Michigan State of the State (SOSS) data

Usage

soss(waves, extra.vars = NULL, survey = FALSE, progress = TRUE)

Arguments

waves

vector: a numeric vector containing the SOSS waves to include (currently available: 79, 82, 84, 85, 86)

extra.vars

vector: a character vector containing the names of variables to be retained from the raw data

survey

boolean: returns an unweighted data.frame if FALSE, or a weighted svydesign object if TRUE

progress

boolean: display a progress bar

Details

The State of the State Survey (SOSS) is regularly collected by the Institute for Public Policy and Social Research (IPPSR) at Michigan State University (MSU). Each wave is collected from a sample of 1000 adults in the US state of Michigan, and includes sampling weights to obtain a sample that is representative of the state's population with respect to age, gender, race, and education. The soss() function reads the raw data from IPPSR's website, extracts and recodes selected variables useful for studying childfree adults and other family statuses, then returns either an unweighted data frame, or a weighted design object that can be analyzed using the survey package. Questions necessary for identifying childfree adults have been asked in five waves, which each include unique questions that may be of interest:

Notes

Value

A data frame or weighted svydesign object containing variables described in the codebook available using vignette("codebooks"). If you are offline, or if the requested data are otherwise unavailable, NULL is returned.

Examples


unweighted <- soss(waves = 86)  #Request unweighted data
if (!is.null(unweighted)) {  #If data was available...
table(unweighted$famstat) / nrow(unweighted)  #Fraction of respondents with each family status
}

weighted <- soss(waves = 86, survey = TRUE)  #Request weighted data
if (!is.null(weighted)) {  #If data was available...
survey::svymean(~famstat, weighted, na.rm = TRUE)  #Estimated prevalence of each family status
}


[Package childfree version 0.0.3 Index]