AVGM | R Documentation |
This function performs multiple imputations on missing values in the response variable Y, using AVGMMI logic with support for grouped data. It is fully self-contained.
AVGM(data, M, midx = 1)
data |
A data frame where the first column is the response variable (Y), and others are predictors (X). |
M |
Number of multiple imputations. |
midx |
Integer indicating which column is the response variable (default = 1). |
A list containing:
betahat |
Final averaged regression coefficient estimates. |
Yhat |
Imputed response variable with all missing values filled in. |
comm |
Completion flag (1 = success). |
set.seed(123)
data <- data.frame(
y = c(rnorm(50), rep(NA, 10)),
x1 = rnorm(60),
x2 = rnorm(60)
)
result <- AVGM(data, M = 10)
head(result$Yhat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.