Check response missingness against observed predictors
Source:R/missingness_diagnostics.R
check_missingness.Rdcheck_missingness() screens whether response missingness is associated with
observed variables by fitting a logistic model for the missing-response
indicator. This is a practical MCAR/MAR review: associations with observed
predictors are compatible with missing at random after conditioning on those
predictors, while missing not at random cannot be confirmed or ruled out from
observed data alone.
Usage
check_missingness(
data,
response_var,
predictors = NULL,
time_var = NULL,
subject_var = NULL,
alpha = 0.05,
max_factor_levels = 20
)Arguments
- data
Data frame containing the response and candidate predictors.
- response_var
Response column name.
- predictors
Optional predictor column names. Defaults to observed columns other than the response, subject identifier, and stored simulation truth columns.
- time_var, subject_var
Optional time and subject identifier column names.
time_varis included as a predictor when present;subject_varis excluded by default.- alpha
Significance threshold used to flag predictor associations.
- max_factor_levels
Maximum number of levels allowed for default factor predictors.