Impute by (educated) guessing
This function use some primitive methods, including mean imputation, median imputation, random guess, or majority imputation (only for categorical variables), to impute a missing data matrix.
guess(x, type = "mean")
x |
a matrix or data frame |
type |
is the guessing type, including "mean" for mean imputation, "median" for median imputation, "random" for random guess, and "majority" for majority imputation for categorical variables. |
data(parkinson) # introduce some random missing values missdata <- SimIm(parkinson, 0.1) # impute by mean imputation impdata <- guess(missdata) # caculate the NRMSE Rmse(impdata, missdata, parkinson, norm = TRUE) # by random guessing, the NRMSE should be much bigger impdata2 <- guess(missdata, "random") Rmse(impdata2, missdata, parkinson, norm = TRUE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.