IMI: Improved Multiple Imputation (IMI) Estimation

View source: R/IMI.R

IMIR Documentation

Improved Multiple Imputation (IMI) Estimation

Description

This function performs Improved Multiple Imputation (IMI) estimation for grouped data with missing values. It iteratively imputes missing values using the LS function and estimates regression coefficients using the PPLS function. The final regression coefficients are averaged across multiple imputations.

Usage

IMI(d, M, midx, n)

Arguments

d

data.frame containing the dependent variable (Y) and independent variables (X).

M

Number of multiple imputations to perform.

midx

Column indices of the missing variables in d.

n

Vector of sample sizes for each group.

Details

The function assumes the data is grouped and contains missing values in specified columns (midx). It uses the LS function to impute missing values and the PPLS function to estimate regression coefficients. The process is repeated M times, and the final regression coefficients are averaged.

Value

A list containing the following elements:

betahat

Average regression coefficients across all imputations.

comm

Indicator variable (0 for single group, 1 for multiple groups).

Examples

# Example data

set.seed(123)
n <- c(300, 300, 400)  # Sample sizes for each group
p <- 5  # Number of independent variables
Y <- rnorm(sum(n))  # Dependent variable
X0 <- matrix(rnorm(sum(n) * p), ncol = p)  # Independent variables matrix
d <- list(p = p, Y = Y, X0 = X0)  # Data list
d$all <- cbind(Y, X0)
# Indices of missing variables (assuming some variables are missing)
midx <- c(2, 3)  # For example, the second and third variables are missing
# Call IMI function
result <- IMI(d, M = 5, midx = midx, n = n)
# View results
print(result$betahat)  # Average regression coefficients


DLMRMV documentation built on April 12, 2025, 1:25 a.m.

Related to IMI in DLMRMV...