Learn R Programming

spaMM (version 1.5.1)

extractors: Functions to extract various components of a fit

Description

logLik extracts the log-likelihood (exact or approximated). fitted extracts fitted values (see fitted.values). fixef extracts the fixed effects coefficients, $\beta$. ranef extracts the predicted random effects, $u$. vcov returns the variance-covariance matrix of the fixed-effects coefficients. Corr returns a correlation matrix of random effects (with restrictions, see Details). predictionCoeffs extracts or precomputes coefficients for prediction (see predict for an example) getDistMat extracts a distance matrix for a Matérn correlation model.

Usage

## S3 method for class 'HLfit':
logLik(object,REML,...)
## S3 method for class 'HLfit':
fitted(object,...)
## S3 method for class 'HLfit':
fixef(object,...)## S3 method for class 'HLfit':
ranef(object,...)
## S3 method for class 'HLfit':
vcov(object,...)
predictionCoeffs(object)
getDistMat(object,scaled=FALSE)
Corr(object,...)

Arguments

object
The return object of an HLfit or similar function.
REML
If TRUE, the function returns the log restricted likelihood (exact or approximated).
scaled
If FALSE, the function ignores the scale parameter $rho$ and returns unscaled distance.
...
Other arguments that may be needed by some method.

Value

  • Return values are numeric (for logLik), vectors (most cases), matrices (for vcov), matrices or dist objects (for getDistMat). ranef returns a vector with attributes, which inherits from class ranef which has its own (undocumented) print method. Corr currently returns the correlation matrix of the random effects which are described as Lv (see HLfit)

Examples

Run this code
data(wafers)
m1 <- HLfit(y ~X1+X2+(1|batch),
          resid.formula = ~ 1 ,data=wafers,HLmethod="ML")
fixef(m1)
vcov(m1)
ranef(m1)
## see 'predict' for an example with predictionCoeffs and getDistMat

Run the code above in your browser using DataLab