Learn R Programming

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

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

0.9.16

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Matthias Speidel

Last Published

June 23rd, 2019

Functions in hmi (0.9.16)

list_of_rounding_degrees_maker

Helps the user to make a list of rounding degrees
contributions4intervals

get the likelihood contributions of interval data
imp_interval

The function to impute interval data variables
suggest_rounding_degrees

suggesting rounding degrees
imp_cat_multi

The function for hierarchical imputation of categorical variables.
factors

Function to get all factors
plot.interval

Plotting interval variables
get_type

Get the type of variables.
nhanes_mod

National Health and Nutrition Examination Survey (2015 - 2016) - modified
Mode

Get the mode
generate_interval

Function to generate an interval object
decompose_interval

decompose up intervals
idf2interval

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

Generic ceiling
imp_cat_single

The function to impute unordered categorical variables
split_interval

Split up intervals
imputationcycle

Cycling
sample_imp

Sample imputation.
+.interval

Adding function
hmi_pool

Averages the results of the imputation function hmi.
Gcsemv

Exam results on the GCSE
extract_varnames

Function to extract the different elements of a formula
center_interval

Function to give the center of the interval
imp_semicont_multi

The function for hierarchical imputation of semicontinuous variables.
nhanes_sub

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

Function to check whether an object is an interval
is.na.interval

is.na for interval objects
imp_semicont_single

The function for hierarchical imputation of semicontinuous variables.
imp_orderedcat_single

The function to impute ordered categorical variables
sna_interval

Get standard NAs from interval data
imp_roundedcont

The function to impute rounded continuous variables
exp

Generic exp
doubleintegral

Function to calculate double integrals
imp_count_multi

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

The function for hierarchical imputation of categorical variables.
imp_count_single

The function for imputation of binary variables.
list_of_rounding_formulas_maker

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

Tabulating interval objects
interval2idf

Transform interval variables to an interval data frame
pbivnormX

calculate probabilities from the cumulative distribution function of a standard bivariate normal distribution
sampler

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

Subtraction function
negloglik2_intervalsonly

calculate the likelihood contribution of interval data only
/.interval

Dividing function
nhanes_imp

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

hmi: Hierarchical Multilevel Imputation.
*.interval

Multiplication function
imp_cont_multi

The function for hierarchical imputation of continuous variables.
[.interval

Index for interval
as.interval

Function to transform objects into an interval object
as.data.frame.interval

Transform interval objects into data.frames
negloglik

calculate the likelihood contribution of the data
^.interval

Power function
head.interval

Head for intervals
imp_cont_single

The function for imputation of continuous variables.
log

Generic log
%%.interval

Modulo function
[<-.interval

Replace for interval
floor

Generic floor
imp_binary_single

The function for imputation of binary variables.
list_of_types_maker

Helps the user to make a list of types.
round

Generic round
chaincheck

Checking the chains on convergence
sqrt

Generic sqrt
fixed_intercept_check

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

cleanup data.frames
imp_binary_multi

The function for hierarchical imputation of binary variables.
list_of_spikes_maker

Helps the user to make a list of spikes.
tail.interval

Tail for intervals
random_intercept_check

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

Standardizing function