PMMI | R Documentation |
Implements PMM algorithm for handling missing data in linear regression models. Uses chained equations approach to generate multiple imputed datasets and pools results using Rubin's rules.
PMMI(data, k = 5, m = 5)
data |
Dataframe with response variable in 1st column and predictors in others |
k |
Number of nearest neighbors for matching (default=5) |
m |
Number of imputations (default=5) |
List containing:
Y |
Original response vector with NAs |
Yhat |
Final imputed response vector (averaged across imputations) |
betahat |
Pooled regression coefficients |
imputations |
List of m completed datasets |
m |
Number of imputations performed |
k |
Number of neighbors used |
# Create dataset with 30% missing values
data <- data.frame(Y=c(rnorm(70),rep(NA,30)), X1=rnorm(100))
results <- PMMI(data, k=5, m=5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.