powered by
Augment X for missing data approach for MNAR
augment.X(X)
Matrix same size as X, with augmented columns and zeros in the missing spots
matrix of covariates, including some missing values (NAs)
set.seed(1) n <- 100 X <- matrix(runif(n*2, 0, 1), ncol=2) X[sample(1:length(X), round(.1*length(X)))] <- NA X.new <- augment.X(X) sum(is.na(X.new))
Run the code above in your browser using DataLab