| extractors | R Documentation |
Most extractors are methods of generic functions defined in base R (see Usage), for which the base documentation may be useful.
\bullet formula extracts the model formula.
\bullet family extracts the assumed distribution family for the response variable.
\bullet terms extracts the formula, with attributes describing the fixed-effect terms.
\bullet nobs returns the length of the response vector.
\bullet logLik extracts the log-likelihood (exact or approximated).
\bullet fitted extracts fitted values.
\bullet response extracts the response (as a vector).
\bullet fixef extracts the fixed effects coefficients, \beta.
\bullet coef may not do anything useful yet.
\bullet 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.
\bullet getDistMat returns a distance matrix for a geostatistical (Matérn etc.) random effect.
\bullet df.residual extracts residual degrees-of-freedom for fitted models (here number of observations minus number of parameters of the model except residual dispersion parameters).
\bullet weights extracts prior weights (as defined by the fitting functions's prior.weights argument).
\bullet get_drawSizes extracts binomial or multinomial draw sizes.
\bullet dev_resids returns a vector of squared (unscaled) deviance residuals, prior-weights if the model had prior weights; and
\bullet deviance returns the sum of squares of these deviance residuals. See residuals.HLfit for details about these concepts, and their relation with the different possible residuals extracted by the latter function.
## S3 method for class 'HLfit'
formula(x, which="hyper", ...)
## S3 method for class 'HLfit'
family(object, submodel=NULL, ...)
## 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'
coef(object, ...)
## S3 method for class 'HLfit'
fixef(object, na.rm=NULL, ...)
## 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, ...)
## S3 method for class 'HLfit'
df.residual(object, ...)
## S3 method for class 'HLfit'
weights(object, type, ...)
##
getDistMat(object, scaled=FALSE, which = 1L)
response(object,...)
dev_resids(object,...)
get_drawSizes(object,p4m="P")
object |
An object of class |
type |
For |
which |
* For |
na.rm |
Whether to include NA values for missing coefficients of rank-deficient model matrices. Default is to exclude them for mixed models and to include them for other ones. See Details for the underlying reason. |
scaled |
If |
x |
For |
max.print |
Controls |
submodel |
Integer: to extract the family for a given submodel in a multivariate-response fit. |
p4m |
Character: for fit objects of class |
... |
Other arguments that may be needed by some method. |
For rank-deficient model matrices, base R procedures lm and glm estimate coefficients for a rank-trimmed matrix and coefficient() returns a full-length vector completed with NA values for coefficients not estimated, while the lme4 fixef method returns a trimmed vector. spaMM has long followed the base R convention for all models but this may impede use of some post-fit procedures initially conceived for lme4 objects (such as lmerTest procedures for LMMs). So now fixef.HLfit trims the vector by default for mixed-effect models only. The default is thus to maximize consistency/compatibility with preexisting procedures despite their inconsistencies with each other.
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.
See summary.HLfit whose return value include the tables of fixed-effects coefficients and random-effect variances displayed by the summary, 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, optimBounds to extract optimization box constraints.
data("wafers")
m1 <- fitme(y ~ X1+X2+(1|batch), data=wafers)
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.