| hhh4_methods | R Documentation |
"hhh4" Objects
Standard print, summary and
extraction methods for hhh4 fits
as is illustrated in Meyer et al. (2017, Section 5),
see \vignettehhh4_spacetime.
Newer broom-style tidy and
glance methods are also provided
but should be considered experimental.
## S3 method for class 'hhh4'
print(x, digits = max(3, getOption("digits") - 3), ...)
## S3 method for class 'hhh4'
summary(object, maxEV = FALSE, ...)
## S3 method for class 'hhh4'
coef(object, se = FALSE, reparamPsi = TRUE,
idx2Exp = NULL, amplitudeShift = FALSE, ...)
## S3 method for class 'hhh4'
fixef(object, ...)
## S3 method for class 'hhh4'
ranef(object, tomatrix = FALSE, intercept = FALSE, ...)
## S3 method for class 'hhh4'
coeflist(x, ...)
## tidy() and glance() methods are exported
## and potentially registered via {generics}
tidy.hhh4(x, effects = c("fixed", "random"),
idx2Exp = NULL, amplitudeShift = FALSE,
conf.int = FALSE, conf.level = 0.95, ...)
glance.hhh4(x, ...)
## S3 method for class 'hhh4'
formula(x, ...)
## S3 method for class 'hhh4'
nobs(object, ...)
## S3 method for class 'hhh4'
logLik(object, ...)
## S3 method for class 'hhh4'
vcov(object, reparamPsi = TRUE,
idx2Exp = NULL, amplitudeShift = FALSE, ...)
## S3 method for class 'hhh4'
confint(object, parm, level = 0.95,
reparamPsi = TRUE, idx2Exp = NULL, amplitudeShift = FALSE, ...)
## S3 method for class 'hhh4'
residuals(object, type = c("deviance", "pearson", "response"), ...)
x, object |
an object of class |
digits |
the number of significant digits to use when printing parameter estimates. |
maxEV |
logical indicating if the summary should contain the
(range of the) dominant eigenvalue as a measure of the importance of
the epidemic components. By default, the value is not calculated as
this may take some seconds depending on the number of time points
and units in |
... |
For the |
reparamPsi |
logical. If |
se |
a logical value indicating if standard errors are required. |
idx2Exp |
integer or character vector selecting parameters
that should be exponentiated, or |
amplitudeShift |
a logical value indicating whether the parameters
for sine/cosine terms modelling seasonal patterns
(see |
tomatrix |
logical. If |
intercept |
logical. If |
effects |
a character vector specifying the groups of parameters
to tabulate. The default is to include |
conf.int |
a logical value indicating if confidence intervals
should be added as columns |
parm |
a vector of numbers or names, specifying which parameters are to be given confidence intervals. If missing, all parameters are considered. |
conf.level, level |
the confidence level required. |
type |
the type of residuals which should be returned. The
alternatives are |
The coef-method returns all estimated (regression)
parameters from a hhh4 model.
If the model includes random effects, those can be extracted with
ranef, whereas fixef returns the fixed parameters.
The coeflist-method extracts the model coefficients in a list
(by parameter group).
The experimental tidy.hhh4 function returns the (requested)
parameters in a data frame with column names following the
broom convention and an extra component column
(with possible values "ar", "ne", "end",
"weights", "dispersion") to discriminate parameters.
This column is especially important for post-processing with,
e.g., modelsummary, which will need
shape = component + term ~ model (or even ‘+ unit’),
as the term column alone does not uniquely identify
parameters (there is one "(Intercept)" per component).
If any non-fixed effects are present, an effect column
is included to categorize parameters of "fixed" and
"random" effects, and unit-specific "ri" values.
If idx2Exp was used, an additional logical column
exp indicates exp-transformed parameters.
The formula-method returns the formulae used for the
three log-linear predictors in a list with elements "ar",
"ne", and "end".
The nobs-method returns the number of observations used
for model fitting.
The logLik-method returns an object of class
"logLik" with "df" and "nobs" attributes.
For a random effects model, the value of the penalized
log-likelihood at the MLE is returned, but degrees of freedom are
not available (NA_real_).
As a consequence, AIC and BIC are only
well defined for models without random effects;
otherwise these functions return NA_real_.
The vcov-method returns the estimated
variance-covariance matrix of the regression parameters.
The estimated variance-covariance matrix of random effects is
available as object$Sigma.
The confint-method returns Wald-type confidence
intervals (assuming asymptotic normality). Note that idx2Exp
gives (symmetric) Wald intervals for the exponentiated parameters
based on the delta method, not exp(CI).
The residuals-method extracts raw ("response") or
"deviance" or standardized ("pearson")
residuals from the model fit similar to
residuals.glm for Poisson or NegBin GLM's.
Note that the squared Pearson residual is equivalent to the
normalized squared error score, which can be computed from the
fitted model using scores(object, "nses").
Michaela Paul and Sebastian Meyer
Meyer, S., Held, L. and Höhle, M. (2017): Spatio-temporal analysis of epidemic phenomena using the R package surveillance. Journal of Statistical Software, 77 (11), 1-55. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v077.i11")}
the plot
and update methods
for fitted "hhh4" models.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.