# only ds_orig known
ds_orig <- data.frame(X = 1:10, Y = 101:101)
ds_imp <- impute_mean(delete_MCAR(ds_orig, 0.4))
evaluate_imputation_parameters(ds_imp, ds_orig = ds_orig)
# true parameters known
ds_orig <- data.frame(X = rnorm(100), Y = rnorm(100, mean = 10))
ds_imp <- impute_mean(delete_MCAR(ds_orig, 0.3))
evaluate_imputation_parameters(ds_imp, pars_true = c(0, 10), parameter = "mean")
evaluate_imputation_parameters(ds_imp, pars_true = c(1, 1), parameter = "var")
# set quantiles
evaluate_imputation_parameters(ds_imp,
pars_true = c(qnorm(0.3), qnorm(0.3, mean = 10)),
parameter = "quantile", probs = 0.3
)
# compare only column Y
evaluate_imputation_parameters(ds_imp,
pars_true = c(Y = 10), parameter = "mean",
cols_which = "Y"
)
Run the code above in your browser using DataLab