Learn R Programming

⚠️There's a newer version (0.4.0) of this package.Take me there.

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.2.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

July 30th, 2020

Functions in missMethods (0.2.0)

delete_MNAR_rank

Create MNAR values using a ranking mechanism
delete_MAR_1_to_x

Create MAR values using MAR1:x
delete_MCAR

Create MCAR values
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_MAR_censoring

Create MAR values using a censoring mechanism
apply_imputation

Apply a function for imputation
delete_MAR_rank

Create MAR values using a ranking mechanism
delete_MNAR_1_to_x

Create MNAR values using MNAR1:x
delete_MAR_one_group

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

LSimpute_adaptive
impute_sRHD

Simple random hot deck imputation
median.factor

Median for ordered factors
impute_in_classes

Impute in classes
impute_LS_array

LSimpute_array
impute_mean

Mean imputation
evaluate_imputed_values

Evaluate imputed values
evaluate_imputation_parameters

Evaluate estimated parameters after imputation
evaluate_parameters

Evaluate estimated parameters
impute_EM

EM imputation
impute_LS_gene

LSimpute_gene
impute_median

Median imputation
impute_mode

Mode imputation
impute_LS_combined

LSimpute_combined
impute_expected_values

Impute expected values
impute_hot_deck_in_classes

Hot deck imputation in imputation classes