imp_mean: Compute mean imputation

View source: R/client.R

imp_meanR Documentation

Compute mean imputation

Description

Calculates the element-wise mean across all stored imputations for a model.

Usage

imp_mean(model_id, ...)

Arguments

model_id

A character model ID, or a fitted model object (list with a ⁠$model_id⁠ element) as returned by midas_fit() or midas().

...

Arguments forwarded to ensure_server().

Value

A data frame with the mean imputed values.

Examples

## Not run: 
df <- data.frame(X1 = rnorm(200), X2 = rnorm(200))
df$X1[sample(200, 40)] <- NA
fit <- midas_fit(df, epochs = 10L)
midas_transform(fit, m = 10)
mean_df <- imp_mean(fit)

## End(Not run)

rMIDAS2 documentation built on March 12, 2026, 9:07 a.m.