Multiple imputation

Metida.milmm

Metida.milmmFunction
milmm(mi::MILMM; n = 100, verbose = true, rng = default_rng())

Multiple imputation.

Warning

Experimental: API not stable

For each subject random vector of missing values generated from distribution:

\[X_{imp} \sim N(\mu_{miss \mid obs}, \Sigma_{miss \mid obs})\]

\[\mu_{miss \mid obs} = \mu_1+ \Sigma_{12} \Sigma_{22}^{-1} (x_{obs}- \mu_2)\]

\[\Sigma_{miss \mid obs} = \Sigma_{11}- \Sigma_{12} \Sigma_{22}^{-1} \Sigma_{21}\]

\[x = \begin{bmatrix}x_{miss} \\ x_{obs} \end{bmatrix}; \mu = \begin{bmatrix}\mu_1 \\ \mu_2 \end{bmatrix}; \Sigma = \begin{bmatrix} \Sigma_{11} & \Sigma_{12} \\ \Sigma_{21} & \Sigma_{22} \end{bmatrix}\]

Example:

lmm = Metida.LMM(@formula(var~sequence+period+formulation), df0m;
random = Metida.VarEffect(Metida.@covstr(formulation|subject), Metida.CSH),
)
Metida.fit!(lmm)
mi = Metida.MILMM(lmm, df0m)
bm = Metida.milmm(mi; n = 100, rng = MersenneTwister(1234))
source
milmm(lmm::LMM, data; n = 100, verbose = true, rng = default_rng())

Multiple imputation in one step. data for lmm and for milmm should be the same, if different data used resulst can be unpredictable.

source

Metida.miboot

Metida.mibootFunction
miboot(mi::MILMM{T}; n = 100, double = true, bootn = 100, verbose = true, rng = default_rng())

Multiple imputation with parametric bootstrap step.

Warning

Experimental: API not stable

Example:

lmm = Metida.LMM(@formula(var~sequence+period+formulation), df0m;
random = Metida.VarEffect(Metida.@covstr(formulation|subject), Metida.CSH),
)
Metida.fit!(lmm)
mi = Metida.MILMM(lmm, df0m)
bm = Metida.miboot(mi; n = 100, rng = MersenneTwister(1234))
source