Learn R Programming

nonprobsampling (version 0.1.0)

parse_ipwm_data: Parse the data list passed to est_pw

Description

Splits the input list into its two parts: the nonprobability sample (`sc`) and one or more reference survey designs (`sp_des`). For each design it calls `extract_analysis_data()` to remove design variables and attach a `sp_wts` column, giving back a plain data frame ready for modeling. If the list elements have no names, or if any element name is an empty string (partially named list), default names `"sp[[1]]"`, `"sp[[2]]"`, ... are assigned to all elements.

Usage

parse_ipwm_data(data)

Value

A list with four elements:

- `sc`: the nonprobability sample (first element of `data`). - `sp_des`: named list of the survey design objects. - `sp_vars`: named list of plain data frames, one per reference survey, with design variables removed and a `sp_wts` column added. - `n_ref`: integer giving the number of reference surveys.

Arguments

data

A named or unnamed list. The first element is the nonprobability sample as a data frame. Every remaining element is a survey design object (`survey.design2`, `survey.design`, or `svyrep.design`).