This function creates a missing data indicator matrix \(R\) that denotes whether
values are observed or missing, i.e., \(r = 1\) if a value is observed, and
\(r = 0\) if a value is missing.
Usage
na.indicator(x, as.na = NULL, check = TRUE)
Value
Returns a matrix or data frame with \(r = 1\) if a value is observed, and \(r = 0\)
if a value is missing.
Arguments
x
a matrix or data frame.
as.na
a numeric vector indicating user-defined missing values,
i.e. these values are converted to NA before conducting
the analysis.
check
logical: if TRUE, argument specification is checked.
Enders, C. K. (2010). Applied missing data analysis. Guilford Press.
Graham, J. W. (2009). Missing data analysis: Making it work in the real world.
Annual Review of Psychology, 60, 549-576.
https://doi.org/10.1146/annurev.psych.58.110405.085530
van Buuren, S. (2018). Flexible imputation of missing data (2nd ed.). Chapman & Hall.