Impute the missing values with expected values given the observed values and estimated parameters assuming a multivariate normal distribution
impute_expected_values(
ds,
mu,
S,
stochastic = FALSE,
M = is.na(ds),
verbose = FALSE
)
A data frame or matrix with missing values.
Vector of means for the variables.
Covariance matrix of the variables.
Logical, should residuals be added to the expected values.
Missing data indicator matrix.
Should messages be given for special cases (see details)?
An object of the same class as ds
with imputed missing values.
Normally, this function is called by other imputation function and should not be called directly. The function imputes the missing values assuming a multivariate normal distribution. This is equivalent to imputing the least squares estimate of the missing values in some kind of way.
If no values is observed in a row or a relevant submatrix of the
covariance matrix (S_22
) is not invertible, the missing values are imputed
with (parts of) mu
(plus a residuum, if stochastich = TRUE
). If
verbose = TRUE
, these cases will be listed in a message. Otherwise, they
will be imputed silently.