Learn R Programming

hmi (version 0.9.13)

sample_imp: Sample imputation.

Description

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

Usage

sample_imp(variable)

Arguments

variable

A vector of size n with missing values.

Value

A list with a n times 1 data.frame without missing values and a list with the chains of the Gibbs-samples for the fixed effects and variance parameters.

Examples

Run this code
# NOT RUN {
set.seed(123)
sample_imp(c(1, NA, 3, NA, 5))
# }

Run the code above in your browser using DataLab