Learn R Programming

spaMM (version 3.2.0)

vcov: Extract covariance or correlation components from a fitted model object

Description

summary(<fit object>)$beta_table returns the table of fixed-effect coefficients as it is printed by summary, including standard errors and t-values. vcov returns the variance-covariance matrix of the fixed-effects coefficients. Corr returns a correlation matrix of random effects.

VarCorr returns (co)variance parameters of random effects, and residual variance, from a fit object of class "HLfit", in a format roughly consistent with the method of objects of class "lme", in particular including columns with consistent names for easier extraction. However, the structure of the return value is not fully specified and some model structures (e.g., including adjacency terms) may not be correctly handled.

Usage

# S3 method for HLfit
vcov(object, ...)
# S3 method for HLfit
VarCorr(x, sigma = 1, message. = TRUE, ...)
Corr(object, ...)

Arguments

object, x

A fitted model object, inheriting from class "HLfit", as returned by the fitting functions in spaMM.

sigma

ignored argument, included for consistency with the generic function.

message.

boolean; whether to print a reminder about the function.

Other arguments that may be needed by some method.

Value

vcov returns a matrix. Corr returns a list, for the different random effect terms. For each random-effect term, the returned element is a non-trivial unconditional correlation matrix of the vector “v” of random effects (v as defined in see Details of HLfit) for this term, if there is any such matrix. Otherwise the returned element is a information message.

VarCorr returns a data frame with columns for the grouping factor, term, variance of random effect, standard deviation (the root of the variance), and optionnally for correlation of random effect in random-coefficient terms. Information about the residual variance is included as the last row in the data frame, when relevant (gaussian- or Gamma-response models with single scalar parameter; beware the meaing of the residual variance parameter for Gamma-response models).

Examples

Run this code
# NOT RUN {
data("wafers")
m1 <- HLfit(y ~X1+X2+(1|batch),
          resid.model = ~ 1 ,data=wafers,HLmethod="ML")
vcov(m1)

# Example from VarCorr() documentation in 'nlme' package
data("Orthodont",package = "nlme")
sp1 <- fitme(distance ~ age+(age|Subject), data = Orthodont, method="REML")
VarCorr(sp1)
# }

Run the code above in your browser using DataLab