spaMM (version 1.9.16)

extractors: Functions to extract various components of a fit

Description

logLik extracts the log-likelihood (exact or approximated). get_any_IC and AIC.HLfit compute model selection/information criteria such as AIC. See the Details for more information about these criteria. dev_resids returns a vector of deviance residuals. deviance returns the sum of these deviance residuals. 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). getDistMat extracts a distance matrix for a Matérn correlation model.

Usage

"logLik"(object,which,...) "fitted"(object,...) "fixef"(object,...)
"ranef"(object,...) "vcov"(object,...) "deviance"(object,...) getDistMat(object,scaled=FALSE) Corr(object,...) dev_resids(object,...) get_any_IC(object, ..., verbose=interactive()) "AIC"(object, ..., k, verbose=interactive())

Arguments

object
The return object of an HLfit or similar function.
which
Which element of the APHLs list to return. The default depends on the fitting method.In particular, if it was REML or one of its variants, the function returns the log restricted likelihood (exact or approximated).
scaled
If FALSE, the function ignores the scale parameter $rho$ and returns unscaled distance.
verbose
Whether to print the model selection criteria or not.
k
For AIC, unused by HLfit method, but included to conform to the generic.
...
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)get_any_IC computes, optionally prints, and returns invisibly the following quantities. The Effective degrees of freedom for the random effects (approximately) characterizes the expectation of a goodness of fit statistic discussed by Lee and Nelder (2001), which gave a general formula for it in HGLMs. The conditional AIC (Vaida and Blanchard 2005) is notable in involving the conditional likelihood and the effective degrees of freedom. Lee et al. (2006) and Ha et al (2007) defined a corrected AIC [i.e., AIC(D*) in their eq. 7] that is here interpreted as the conditional AIC. The conditional AIC returned by HLfit includes both this effective df, the df for estimated fixed effects, and the df for estimated parameters of the variance of random effects.Also returned are the marginal AIC (Akaike's classical AIC), and a focussed AIC for dispersion parameters (dispersion AIC) discussed by Ha et al (2007; eq.10). This diversity of criteria should encourage users to think twice before applying model selection automatically, which is no better although more fashionable than misuses of simple null hypothesis testing. Also, alternative procedures for model choice can be considered (e.g. Cox and Donnelly, 2011, p. 130-131).

Examples

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

Run the code above in your browser using DataCamp Workspace