Learn R Programming

DLMRMV (version 1.0.0)

CSLMI: CSLMI: Consensus-based Stochastic Linear Multiple Imputation (Simplified Version)

Description

Performs multiple imputation and parameter estimation using a consensus-based approach. The response variable is in the first column, all other columns are predictors, missing values are automatically detected, the whole dataset is treated as one block.

Usage

CSLMI(data, M)

Value

A list containing:

Yhat

Imputed response values.

betahat

Average regression coefficients across imputations.

comm

Communication cost (number of messages passed).

A list containing the following components:

Yhat

Imputed response vector with missing values filled in.

betahat

Final regression coefficients.

Arguments

data

Dataframe with response variable in 1st column and predictors in others

M

Number of imputations

Examples

Run this code
set.seed(123)
data <- data.frame(
  y = c(rnorm(50), rep(NA, 10)),
  x1 = rnorm(60),
  x2 = rnorm(60)
)
result <- CSLMI(data = data, M = 10)
head(result$Yhat)
print(result$betahat)
print(result$comm)

Run the code above in your browser using DataLab