Learn R Programming

DLMRMV (version 1.0.0)

AVGM: Averaged Generalized Method of Moments Imputation (AVGM)

Description

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.

Usage

AVGM(data, M, midx = 1)

Value

A list containing:

betahat

Final averaged regression coefficient estimates.

Yhat

Imputed response variable with all missing values filled in.

comm

Completion flag (1 = success).

Arguments

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).

Examples

Run this code
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)

Run the code above in your browser using DataLab