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

89

Version

0.9.13

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Matthias Speidel

Last Published

June 1st, 2018

Functions in hmi (0.9.13)

imp_cont_multi

The function for hierarchical imputation of continuous variables.
floor

Generic floor
hmi_pool

Averages the results of the imputation function hmi.
imp_count_multi

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

The function for hierarchical imputation of categorical variables.
imp_cat_single

The function to impute unordered categorical variables
imp_cont_single

The function for imputation of continuous variables.
idf2interval

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

The function for imputation of binary variables.
imp_binary_single

The function for imputation of binary variables.
imputationcycle

Cycling
imp_semicont_multi

The function for hierarchical imputation of semicontinuous variables.
imp_binary_multi

The function for hierarchical imputation of binary variables.
list_of_types_maker

Helps the user to make a list of types.
imp_semicont_single

The function for hierarchical imputation of semicontinuous variables.
imp_orderedcat_multi

The function for hierarchical imputation of categorical variables.
list_of_rounding_degrees_maker

Helps the user to make a list of rounding degrees
imp_interval

The function to impute interval data variables
imp_orderedcat_single

The function to impute ordered categorical variables
pbivnormX

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

Helps the user to make a list of spikes.
imp_roundedcont

The function to impute rounded continuous variables
suggest_rounding_degrees

suggesting rounding degrees
/.interval

Dividing function
stand

Standardizing function
*.interval

Multiplication function
^.interval

Power function
plot.interval

Plotting interval variables
list_of_rounding_formulas_maker

Helps the user to make a list of rounding formulas for the rounding degrees
+.interval

Adding function
-.interval

Subtraction function
%%.interval

Modulo function
interval2idf

Transform interval variables to an interval data frame
random_intercept_check

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

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

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

is.na for interval objects
negloglik

calculate the likelihood contribution of the data
log

Generic log
table

Tabulating interval objects
tail

Generic tail
nhanes_sub

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

Function need to multivariate samples of a truncated multivariate normal distribution
negloglik2_intervalsonly

calculate the likelihood contribution of interval data only
nhanes_imp

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

Split up intervals
sna_interval

Get standard NAs from interval data
round

Generic round
sample_imp

Sample imputation.
resetPar

Function to reset all graphics parameters
sqrt

Generic sqrt
decompose_interval

decompose up intervals
as.data.frame.interval

Transform interval objects into data.frames
cleanup

cleanup data.frames
contributions4intervals

get the likelihood contributions of interval data
chaincheck

Checking the chains on convergence
ceiling

Generic ceiling
center.interval

Function to give the center of the interval
Mode

Get the mode
generate_interval

Function to generate an interval object
Gcsemv

Exam results on the GCSE
hmi

hmi: Hierarchical Multilevel Imputation.
fixed_intercept_check

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

Function to calculate double integrals
extract_varnames

Function to extract the different elements of a formula
as.interval

Function to transform objects into an interval object
head

Generic head
factors

Function to get all factors
exp

Generic exp
get_type

Get the type of variables.