Functions to extract various components of a fit
formula
extracts the model formula.
family
extracts the response family.
terms
extracts the formula, with attributes describing the fixed-effect terms.
nobs
returns the length of the response vector.
logLik
extracts the log-likelihood (exact or approximated).
dev_resids
returns a vector of squared (unscaled) deviance residuals (the summands in McCullagh and Nelder 1989, p. 34).
deviance
returns the sum of squares of these (unscaled) deviance residuals, that is (consistently with stats::deviance
) the unscaled deviance.
fitted
extracts fitted values (see fitted.values
).
response
extracts the response (as a vector).
fixef
extracts the fixed effects coefficients, β.
ranef
extracts the predicted random effects, Lv (default since version 1.12.0), or optionally u (see random-effects
for definitions). print.ranef
controls their printing.
getDistMat
returns a distance matrix for a geostatistical (Matérn etc.) random effect.
## S3 method for class 'HLfit' formula(x, which="hyper", ...) ## S3 method for class 'HLfit' family(object, ...) ## S3 method for class 'HLfit' terms(x, ...) ## S3 method for class 'HLfit' nobs(object, ...) ## S3 method for class 'HLfit' logLik(object, which, ...) ## S3 method for class 'HLfit' fitted(object, ...) ## S3 method for class 'HLfit' fixef(object, ...) ## S3 method for class 'HLfit' ranef(object, type = "correlated", ...) ## S3 method for class 'ranef' print(x, max.print = 40L, ...) ## S3 method for class 'HLfit' deviance(object, ...) ## getDistMat(object, scaled=FALSE, which = 1L) response(object,...) dev_resids(object,...)
object |
An object of class |
type |
For |
which |
For |
scaled |
If |
x |
For |
max.print |
Controls |
... |
Other arguments that may be needed by some method. |
With which="LogL_Lap"
, logLik()
returns a Laplace approximation of log-likelihood based on the observed Hessian, rather than the expected Hessian. This is implemented only for the case family=Gamma(log)
, for demonstration purposes.
formula
returns a formula
, except a list of them from fitmv()
output.
terms
returns an object of class c("terms", "formula")
which contains the terms representation of a symbolic model. See terms.object
for its structure. terms(<fitmv() result>)
returns a list of such terms.
Other return values are numeric (for logLik
), vectors (most cases), matrices or dist objects (for getDistMat
), or a family object (for family
). ranef
returns a list of vectors or matrices (the latter for random-coefficient terms).
McCullagh, P. and Nelder J. A. (1989) Generalized linear models. Second ed. Chapman & Hall: London.
Lee, Y., Nelder, J. A. (2001) Hierarchical generalised linear models: A synthesis of generalised linear models, random-effect models and structured dispersions. Biometrika 88, 987-1006.
Lee, Y., Nelder, J. A. and Pawitan, Y. (2006) Generalized linear models with random effects: unified analysis via h-likelihood. Chapman & Hall: London.
See residuals.HLfit
to extract various residuals, residVar
to extract residual variances or information about residual variance models, hatvalues
to extract leverages, get_matrix
to extract the model matrix and derived matrices, and vcov.HLfit
to extract covariances matrices from a fit, get_RLRsim_args
to extract arguments for (notably) tests of random effects in LMMs.
data("wafers") m1 <- HLfit(y ~ X1+X2+(1|batch), resid.model = ~ 1, data=wafers, method="ML") fixef(m1) ranef(m1) data("blackcap") fitobject <- fitme(migStatus ~ 1 + Matern(1|longitude+latitude),data=blackcap, fixed=list(nu=4,rho=0.4,phi=0.05)) getDistMat(fitobject)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.