View source: R/09_Imputation.R
| GenImputation | R Documentation |
Generates a single stochastic imputation of the data from a fitted GMM.
Observed values are unchanged; missing values are drawn from the conditional
distribution given the observed data (or from the marginal distribution for
fully missing rows). For multiple imputation, call this function repeatedly
and combine results using CombineMIs.
GenImputation(fit)
fit |
Fitted model of class |
Numeric matrix with the same dimensions as fit@Data, with
missing values imputed. If the fitted data have no missing values, returns
the original data unchanged.
set.seed(100)
# Generate data and introduce missingness.
data <- rGMM(n = 25, d = 2, k = 1)
data[1, 1] <- NA
data[2, 2] <- NA
data[3, ] <- NA
# Fit GMM.
fit <- FitGMM(data)
# Generate imputation.
imputed <- GenImputation(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.