The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
Here we describe the variance-covariance matrix adjustment of coefficients.
To estimate the covariance matrix of coefficients, there are many
ways. In mmrm
package, we implemented asymptotic,
empirical, Jackknife and Kenward-Roger methods. For simplicity, the
following derivation are all for unweighted mmrm. For weighted mmrm, we
can follow the details of
weighted least square estimator.
Asymptotic covariance are derived based on the estimate of β.
Following the definition in details in model fitting, we have
ˆβ=(X⊤WX)−1X⊤WY
cov(ˆβ)=(X⊤WX)−1X⊤Wcov(ϵ)WX(X⊤WX)−1=(X⊤WX)−1
Where W is the block diagonal matrix of inverse of covariance matrix of ϵ.
Empirical covariance, also known as the robust sandwich estimator, or “CR0”, is derived by replacing the covariance matrix of ϵ by observed covariance matrix.
cov(ˆβ)=(X⊤WX)−1(∑iX⊤iWiˆϵiˆϵ⊤iWiXi)(X⊤WX)−1=(X⊤WX)−1(∑iX⊤iLiL⊤iˆϵiˆϵ⊤iLiL⊤iXi)(X⊤WX)−1
Where Wi is the block diagonal
part for subject i of W matrix, ˆϵi is the observed residuals
for subject i, Li is the Cholesky
factor of Σ−1i (Wi=LiL⊤i). In the sandwich, the
score X⊤iWiˆϵi
computed for subject i can be
accessed by
component(mmrm_obj, name = "score_per_subject")
.
See the detailed explanation of these formulas in the Weighted Least Square Empirical Covariance vignette.
Jackknife method in mmrm
is the “leave-one-cluster-out”
method. It is also known as “CR3”. Following McCaffrey and Bell (2003), we have
cov(ˆβ)=(X⊤WX)−1(∑iX⊤iLi(Ii−Hii)−1L⊤iˆϵiˆϵ⊤iLi(Ii−Hii)−1L⊤iXi)(X⊤WX)−1
where
Hii=Xi(X⊤X)−1X⊤i
Please note that in the paper there is an additional scale parameter n−1n where n is the number of subjects, here we do not include this parameter.
Bias-reduced method, also known as “CR2”, provides unbiased under correct working model. Following McCaffrey and Bell (2003), we have cov(ˆβ)=(X⊤WX)−1(∑iX⊤iLi(Ii−Hii)−1/2L⊤iˆϵiˆϵ⊤iLi(Ii−Hii)−1L⊤iXi)(X⊤WX)−1
where
Hii=Xi(X⊤X)−1X⊤i
Kenward-Roger covariance is an adjusted covariance matrix for small sample size. Details can be found in Kenward-Roger
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.