CSLMI {DLMRMV} | R Documentation |
CSLMI: Consensus-based Stochastic Linear Multiple Imputation (Simplified Version)
Description
Performs multiple imputation and parameter estimation using a consensus-based approach. It assumes: - 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)
Arguments
data |
Dataframe with response variable in 1st column and predictors in others |
M |
Number of imputations |
Value
A list containing:
Yhat |
Matrix of size n x M with imputed response values. |
betahat |
Average regression coefficients across imputations. |
comm |
Communication cost (number of messages passed). |
Examples
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)
[Package DLMRMV version 0.2.0 Index]