lmerSummary: Derive VCA-Summary Table from an Object Fitted via Function...

View source: R/reml.R

lmerSummaryR Documentation

Derive VCA-Summary Table from an Object Fitted via Function lmer

Description

This function builds a variance components analysis (VCA) table from an object representing a model fitted by function lmer of the lme4 R-package.

Usage

lmerSummary(
  obj,
  VarVC = TRUE,
  terms = NULL,
  Mean = NULL,
  cov = FALSE,
  X = NULL,
  tab.only = FALSE
)

Arguments

obj

(lmerMod) object as returned by function lmer

VarVC

(logical) TRUE = the variance-covariance matrix of variance components will be approximated following the Giesbrecht & Burns approach, FALSE = it will not be approximated

terms

(character) vector, optionally defining the order of variance terms to be used

Mean

(numeric) mean value used for CV-calculation

cov

(logical) TRUE = in case of non-zero covariances a block diagonal matrix will be constructed, FALSE = a diagonal matrix with all off-diagonal elements being equal to zero will be contructed

X

(matrix) design matrix of fixed effects as constructed to meet VCA-package requirements

tab.only

(logical) TRUE = will return only the VCA-results table as 'data.frame', argument 'VarVC' will be automatically set to 'FALSE' (see details)

Details

It applies the approximation of the variance-covariance matrix of variance components according to Giesbrecht & Burns (1985) and uses this information to approximate the degrees of freedom according to Satterthwaite (see SAS PROC MIXED documentation option 'CL').

This function can be used to create a VCA-results table from almost any fitted 'lmerMod'-object, i.e. one can apply it to a model fitted via function lmer of the lme4-package. The only additional argument that needs to be used is 'tab.only' (see examples).

Value

(list) still a premature 'VCA'-object but close to a "complete" 'VCA'-object

Author(s)

Andre Schuetzenmeister andre.schuetzenmeister@roche.com

References

Searle, S.R, Casella, G., McCulloch, C.E. (1992), Variance Components, Wiley New York

Giesbrecht, F.G. and Burns, J.C. (1985), Two-Stage Analysis Based on a Mixed Model: Large-Sample Asymptotic Theory and Small-Sample Simulation Results, Biometrics 41, p. 477-486

See Also

remlVCA, remlMM

Examples

## Not run: 
# fit a model with a VCA-function first
data(VCAdata1)
fit0 <- remlVCA(y~(device+lot)/day/run, subset(VCAdata1, sample==5))
fit0

# fit the same model with function 'lmer' of the 'lme4'-package
library(lme4)
fit1 <- lmer(y~(1|device)+(1|lot)+(1|device:lot:day)+(1|device:lot:day:run),
subset(VCAdata1, sample==5))
lmerSummary(fit1, tab.only=TRUE)

## End(Not run)

VCA documentation built on May 29, 2024, 1:48 a.m.