Learn R Programming

hmi (version 0.9.16)

imp_interval: The function to impute interval data variables

Description

This functions imputes interval data variables. Those are variables, that consists of a lower and upper (numeric) boundary. Technically those boundaries are contained in a string, separated by a semi colon. E.g. if a person reports there income to be something between 3000 and 4000 dollars, its value in the interval covariate would be "3000;4000". Left (resp. right) censored data can be denoted by "-Inf;x" (resp. "x;Inf"), with x being the (numeric) observed value.

Usage

imp_interval(y_imp, X_imp, pvalue = 0.2, k = Inf)

Arguments

y_imp

A Vector from the class interval with the variable to impute.

X_imp

A data.frame with the fixed effects variables.

pvalue

A numeric between 0 and 1 denoting the threshold of p-values a variable in the imputation model should not exceed. If they do, they are excluded from the imputation model.

k

An integer defining the allowed maximum of levels in a factor covariate.

Value

A n x 1 data.frame with the original and imputed values. Note that this function won't return interval data as its purpose is to "break" the interval answers into precise answers.