sample_imp: Sample imputation.

Description Usage Arguments Value Examples

View source: R/hmi_smallfunctions.R

Description

Function to sample values in a variable from other (observed) values in this variable. So this imputation does not use further covariates.

Usage

1
sample_imp(variable)

Arguments

variable

A vector of size n with missing values.

Value

A n x 1 data.frame with the observed and imputed data

Examples

1
2
set.seed(123)
sample_imp(c(1, NA, 3, NA, 5))

hmi documentation built on Oct. 23, 2020, 7:31 p.m.