Learn R Programming

The hmi package allows user to run single level and multilevel imputation models.

The user just has to pass the data to the main function and, optionally, his analysis model. Basically the package then translates this analysis model into commands to impute the data according to it with functions from mice, MCMCglmm or routines build for this package.

As a brief example try:

example_2 <- CO2
#standardizing the variable:
example_2$conc <- (example_2$conc - mean(example_2$conc))/sd(example_2$conc)
#adding an intercept variable:
example_2$Intercept <- 1

#running the imputation:
library("hmi")
result_multi <- hmi(data = example_2, model_formula = uptake ~ 1 + conc + (1 + conc | Plant))
## [1] "We interprete Intercept as the intercept variable and set its value to 1."
## [1] "We interprete Plant as the cluster indicator and treat it as a factor."

For more details, please read the Vignette.

Copy Link

Version

Install

install.packages('hmi')

Monthly Downloads

164

Version

1.0.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Matthias Speidel

Last Published

October 1st, 2020

Functions in hmi (1.0.0)

as.data.frame.interval

Transform interval objects into data.frames
as.interval

Function to transform objects into an interval object
/.interval

Dividing function
%%.interval

Modulo function
chaincheck

Checking the chains on convergence
list_of_rounding_degrees_maker

Helps the user to make a list of rounding degrees
cleanup

cleanup data.frames
exp.interval

Exp function for interval objects
doubleintegral

Function to calculate double integrals
imp_binary_single

The function for imputation of binary variables.
+.interval

Adding function
imp_binary_multi

The function for hierarchical imputation of binary variables.
imputationcycle

Cycling
interval2idf

Transform interval variables to an interval data frame
-.interval

Subtraction function
extract_varnames

Function to extract the different elements of a formula
Gcsemv

Exam results on the GCSE
Mode

Get the mode
split_interval

Split up intervals
nhanes_sub

A subset of the National Health and Nutrition Examination Survey (2015 - 2016)
sna_interval

Get standard NAs from interval data
list_of_rounding_formulas_maker

Helps the user to make a list of rounding formulas for the rounding degrees
nhanes_mod

National Health and Nutrition Examination Survey (2015 - 2016) - modified
[.interval

Index for interval
head.interval

Head for intervals
imp_cont_multi

The function for hierarchical imputation of continuous variables.
contributions4intervals

get the likelihood contributions of interval data
imp_cont_single

The function for imputation of continuous variables.
hmi

hmi: Hierarchical Multilevel Imputation.
decompose_interval

decompose up intervals
[<-.interval

Replace for interval
fixed_intercept_check

Function to check multilevel models on the existence of fixed intercepts
generate_interval

Function to generate an interval object
ceiling.interval

Ceiling funtion for intervals
get_type

Get the type of variables.
center_interval

Function to give the center of the interval
factors

Function to get all factors
imp_count_multi

The function for hierarchical imputation of variables with count data.
imp_orderedcat_single

The function to impute ordered categorical variables
imp_roundedcont

The function to impute rounded continuous variables
floor.interval

Floor function for interval objects Floor function for interval objects
hmi_pool

Averages the results of the imputation function hmi.
round.interval

Round function for interval objects
imp_cat_single

The function to impute unordered categorical variables
is_interval

Function to check whether an object is an interval
imp_cat_multi

The function for hierarchical imputation of categorical variables.
is.na.interval

is.na for interval objects
sample_imp

Sample imputation.
random_intercept_check

Function to check multilevel models on the existence of random intercepts
idf2interval

Transform interval data frames into data.frames with interval variables
imp_count_single

The function for imputation of binary variables.
sampler

Function need to multivariate samples of a truncated multivariate normal distribution
*.interval

Multiplication function
pbivnormX

calculate probabilities from the cumulative distribution function of a standard bivariate normal distribution
^.interval

Power function
plot.interval

Plotting interval variables
imp_semicont_single

The function for hierarchical imputation of semicontinuous variables.
list_of_types_maker

Helps the user to make a list of types.
list_of_spikes_maker

Helps the user to make a list of spikes.
imp_semicont_multi

The function for hierarchical imputation of semicontinuous variables.
tail.interval

Tail for intervals
nhanes_imp

National Health and Nutrition Examination Survey (2015 - 2016) - imputed
negloglik2_intervalsonly

calculate the likelihood contribution of interval data only
imp_interval

The function to impute interval data variables
log.interval

Log function for interval objects
imp_orderedcat_multi

The function for hierarchical imputation of categorical variables.
negloglik

calculate the likelihood contribution of the data
sqrt.interval

Sqrt function for interval objects
suggest_rounding_degrees

suggesting rounding degrees
table

Tabulating interval objects
stand

Standardizing function