Learn R Programming

cbass (version 0.1)

augment.X: Augment X for missing data approach for MNAR

Description

Augment X for missing data approach for MNAR

Usage

augment.X(X)

Value

Matrix same size as X, with augmented columns and zeros in the missing spots

Arguments

X

matrix of covariates, including some missing values (NAs)

Examples

Run this code
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