Learn R Programming

DLMRMV (version 1.0.0)

DAVGMMI: Impute Missing Values in Response Variable Y Using Distributed AVGMMI Method (With Grouping)

Description

This function implements the Distributed Averaged Generalized Method of Moments Imputation (DAVGMMI) to fill in missing values in the response variable Y based on observed covariates X. Assumes a single group structure and does not require group size input (`n`).

Usage

DAVGMMI(data, R, M)

Value

A list containing:

Yhat

The vector of Y with missing values imputed.

betahat

Final averaged regression coefficient estimates used for imputation.

Arguments

data

A data frame or matrix where the first column is the response variable Y (may contain NA), and remaining columns are covariates X.

R

Number of simulations for stable Beta estimation.

M

Number of multiple 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 <- DAVGMMI(data, R = 50, M = 10)
head(result$Yhat)

Run the code above in your browser using DataLab