Companion R package for the course "Statistical analysis
of correlated and repeated measurements for health science
researchers" taught by the section of Biostatistics of the University
of Copenhagen. It implements linear mixed models where the model for the variance-covariance of the residuals
is specified via patterns (compound symmetry, toeplitz, unstructured, ...). Statistical inference for mean, variance, and correlation parameters
is performed based on the observed information and a Satterthwaite approximation of the degrees of freedom.
Normalized residuals are provided to assess model misspecification.
Statistical inference can be performed for arbitrary linear or non-linear combination(s) of model coefficients.
Predictions can be computed conditional to covariates only or also to outcome values.
Maintainer: Brice Ozenne brice.mh.ozenne@gmail.com (ORCID)
Authors:
Julie Forman jufo@sund.ku.dk (ORCID)
Notations: the linear mixed model estimated by lmm
is denoted:
$$ \mathbf{Y}_{i} = \mathbf{X}_{i}\beta+\boldsymbol{\varepsilon}_i $$
where
\(\mathbf{Y}=(Y_1,\ldots,Y_m)\): vector of outcomes.
\(\mathbf{X}=(X_1,\ldots,X_p)\): design matrix (extractor: model.matrix.lmm
).
\(\boldsymbol{\varepsilon}\): vector of residuals with 0-mean and variance \(\Omega_i\) (extractor: residuals.lmm
).
\(\beta\): estimated mean coefficients relative to \(X\) (extractor: coef.lmm
).
\(\Omega\): the modeled variance-covariance of the residuals with diagonal elements \(\sigma^2_{j}\) (extractor: sigma.lmm
).
\(i\) indexes the cluster (level where replicates are assumed independent).
\(j\) indexes the repetitions, e.g. the variance of \(\varepsilon_{ij}\) is \(\sigma^2_{ij}\).
Covariance patterns: \(\Omega\) can be parametrized as:
ID
: identity (no correlation, constant variance).
IND
: independent (no correlation, time-specific variance).
CS
: compound symmetry (constant correlation and variance). Can also be used to specify a nested random effect structure or a block specific correlation and variance.
RE
: random effects.
TOEPLITZ
: toeplitz (lag-specific correlation, time-specific variance).
UN
: unstructured (time-specific correlation, time-specific variance).
It possible to stratify each structure with respect to a categorical variable.
Optimizer: the default optimizer, "FS"
, implements a fisher scoring algorithm descent with back-tracking in case of decreasing or undefined log-likelihood.
It does not constrain \(\Omega\) to be positive definite which may cause problem in small sample or complex models.
It is possible to use other optimizer inferfaced by optimx::optimx
.
Keywords: documented methods/functions are classified according to the following keywords
models: function fitting a statistical model based on a dataset (e.g. lmm
, lmmCC
, mlmm
, mt.test
, partialCor
)
htest: methods performing statistical inference based on an existing model (e.g. anova.lmm
, estimate.lmm
, effects.lmm
, profile.lmm
, proportion
, rbind.Wald_lmm
, resample.lmm
)
methods: extractors (e.g. coef.lmm
, confint.lmm
, df.residual.lmm
, fitted.lmm
, iid.lmm
, information.lmm
, levels.lmm
, logLik.lmm
, manifest.lmm
, model.frame.lmm
, model.matrix.lmm
, model.tables.lmm
, nobs.lmm
, predict.lmm
, ranef.lmm
, residuals.lmm
, score.lmm
, sigma.lmm
, summary.lmm
, vcov.lmm
, weights.Wald_lmm
)
utilities: function used to facilitate the user interface (e.g. add
, baselineAdjustment
, LMMstar.options
, remove
, scatterplot
, summarize
, summarizeNA
)
datasets: dataset stored in the package (e.g. abetaW
)
hplot: graphical display (e.g. autoplot.lmm
or plot.lmm
)
datagen: function for generating data sets (e.g. sampleRem
)
multivariate: covariance patterns (e.g. ID
, IND
, CS
, RE
, TOEPLITZ
, UN
, CUSTOM
)
Useful links: