Learn R Programming

missMethods (version 0.2.0)

evaluate_imputation_parameters: Evaluate estimated parameters after imputation

Description

Compares estimated parameters after imputation to true parameters or estimates based on the original dataset

Usage

evaluate_imputation_parameters(
  ds_imp,
  ds_orig = NULL,
  pars_true = NULL,
  parameter = "mean",
  criterion = "RMSE",
  cols_which = seq_len(ncol(ds_imp)),
  tolerance = sqrt(.Machine$double.eps),
  ...,
  imp_ds,
  true_pars,
  which_cols
)

Arguments

ds_imp

A data frame or matrix with imputed values.

ds_orig

A data frame or matrix with original (true) values.

pars_true

True parameters, normally a vector or a matrix.

parameter

A string specifying the estimated parameters for comparison.

criterion

A string specifying the used criterion for comparing the imputed and original values.

cols_which

Indices or names of columns used for evaluation.

tolerance

Numeric, only used for criterion = "precision": numeric differences smaller than tolerance are treated as zero/equal.

...

Further arguments passed to the function for parameter estimation.

imp_ds

Deprecated, renamed to ds_imp.

true_pars

Deprecated, renamed to pars_true.

which_cols

Deprecated, renamed to cols_which.

Value

A numeric vector of length one.

Details

Either ds_orig or pars_true must be supplied and the other one must be NULL (default: both are NULL, just supply one, see examples). The following parameters are implemented: "mean", "median", "var", "sd", "quantile", "cov", "cov_only", cor", "cor_only". Some details follow:

  • "var", "cov" and "cov_only": For "var" only the variances of the columns (the diagonal elements of the covariance matrix) are compared. For "cov" the whole covariance matrix is compared. For "cov_only" only the upper triangle (excluding the diagonal) of the covariance matrix is compared.

  • "cor", "cor_only": For "cor" the whole correlation matrix is compared. For "cor_only" only the upper triangle (excluding the diagonal) of the correlation matrix is compared.

  • "quantile": the quantiles can be set via the additional argument probs (see examples). Otherwise, the default quantiles from quantile will be used.

The argument cols_which allows the selection of columns for comparison (see examples). If pars_true is used, it is assumed that only relevant parameters are supplied (see examples).

Possible choices for the argument criterion are documented in evaluate_imputed_values

References

Cetin-Berber, D. D., Sari, H. I., & Huggins-Manley, A. C. (2019). Imputation Methods to Deal With Missing Responses in Computerized Adaptive Multistage Testing. Educational and psychological measurement, 79(3), 495-511.

See Also

Other evaluation functions: evaluate_imputed_values(), evaluate_parameters()

Examples

Run this code
# NOT RUN {
# 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