EMRE: EM Algorithm for Linear Regression with Missing Data

View source: R/EMRE.R

EMRER Documentation

EM Algorithm for Linear Regression with Missing Data

Description

EM Algorithm for Linear Regression with Missing Data

Usage

EMRE(data, d = 1, tol = 1e-06, nb = 100, niter = 1)

Arguments

data

Dataframe with first column as response (Y) and others as predictors (X)

d

Initial convergence threshold (default=1)

tol

Termination tolerance (default=1e-6)

nb

Maximum iterations (default=100)

niter

Starting iteration counter (default=1)

Value

List containing:

Yhat

Imputed response vector

betahat

Estimated coefficients

Examples

# Generate data with 20% missing Y values
set.seed(123)
data <- data.frame(Y=c(rnorm(80),rep(NA,20)), X1=rnorm(100), X2=rnorm(100))

# Run EM algorithm
result <- EMRE(data, d=1, tol=1e-5, nb=50)
print(result$betahat) # View coefficients

DLMRMV documentation built on Aug. 8, 2025, 6:27 p.m.

Related to EMRE in DLMRMV...