Learn R Programming

missMethods

The goal of missMethods is to make the creation and handling of missing data as well as the evaluation of missing data methods easier.

Installation

You can install the released version of missMethods from CRAN with:

install.packages("missMethods")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("torockel/missMethods")

Usage

missMethods mainly provides three types of functions:

  • delete_ functions for generating missing values
  • impute_ functions for imputing missing values
  • evaluate_ functions for evaluating missing data methods

Run help(package = "missMethods") to see all functions. More details for the delete_ functions are given in a vignette (run vignette("Generating-missing-values")).

Example

This is a very basic workflow to generate missing values, impute the generated missing values and evaluate the imputation result:

library(missMethods)
set.seed(123)
ds_comp <- data.frame(X = rnorm(100), Y = rnorm(100))
ds_mis <- delete_MCAR(ds_comp, 0.3)
ds_imp <- impute_mean(ds_mis)
evaluate_imputed_values(ds_imp, ds_comp, "RMSE")
#> [1] 0.5328238

Copy Link

Version

Install

install.packages('missMethods')

Monthly Downloads

653

Version

0.4.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

September 16th, 2022

Functions in missMethods (0.4.0)

impute_EM

EM imputation
delete_MNAR_rank

Create MNAR values using a ranking mechanism
impute_LS_gene

LSimpute_gene
impute_expected_values

Impute expected values
impute_LS_adaptive

LSimpute_adaptive
impute_LS_array

LSimpute_array
evaluate_imputation_parameters

Evaluate estimated parameters after imputation
impute_LS_combined

LSimpute_combined
evaluate_imputed_values

Evaluate imputed values
evaluate_parameters

Evaluate estimated parameters
median.factor

Median for ordered factors
impute_median

Median imputation
impute_mean

Mean imputation
impute_mode

Mode imputation
impute_sRHD

Simple random hot deck imputation
impute_in_classes

Impute in classes
impute_hot_deck_in_classes

Hot deck imputation in imputation classes
count_NA

Count the number of NAs
delete_MAR_rank

Create MAR values using a ranking mechanism
delete_MAR_one_group

Create MAR values by deleting values in one of two groups
delete_MAR_1_to_x

Create MAR values using MAR1:x
apply_imputation

Apply a function for imputation
delete_MNAR_censoring

Create MNAR values using a censoring mechanism
delete_MNAR_one_group

Create MNAR values by deleting values in one of two groups
delete_MCAR

Create MCAR values
delete_MAR_censoring

Create MAR values using a censoring mechanism
delete_MNAR_1_to_x

Create MNAR values using MNAR1:x