Learn R Programming

nonprobsampling (version 0.1.0)

prepare_sc_data: Extract and align sc data from a build object

Description

Reads the raw sc sample, the build-stage complete-case index (`keep_sc`), the covariate matrix `Xc`, and the pseudo-weights from `build`. Remove NA placeholders inserted by `na.exclude` so that all returned vectors and matrices have the same length (the number of build-stage complete cases).

Usage

prepare_sc_data(build)

Value

A list with components:

- `sc`: data frame of build-stage complete cases. - `X`: covariate matrix `build$internal$Xc`. - `w`: pseudo-weight vector with NA placeholders removed. - `idx_keep`: integer index of which rows of `raw_sc` were retained.

Arguments

build

A `pw_fit` object returned by the build step.