Description Usage Arguments Details Value Author(s) Examples
Besides print
and summary
methods there
are also some standard extraction methods defined for objects of class
"twinstim"
: vcov
, logLik
, and
nobs
. This
also enables the use of, e.g., confint
and
AIC
. The model summary
can be exported to LaTeX
by the corresponding toLatex
or xtable
methods.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31  ## S3 method for class 'twinstim'
print(x, digits = max(3, getOption("digits")  3), ...)
## S3 method for class 'twinstim'
summary(object, test.iaf = FALSE,
correlation = FALSE, symbolic.cor = FALSE, runtime = FALSE, ...)
## S3 method for class 'twinstim'
coeflist(x, ...)
## S3 method for class 'twinstim'
vcov(object, ...)
## S3 method for class 'twinstim'
logLik(object, ...)
## S3 method for class 'twinstim'
nobs(object, ...)
## S3 method for class 'summary.twinstim'
print(x,
digits = max(3, getOption("digits")  3), symbolic.cor = x$symbolic.cor,
signif.stars = getOption("show.signif.stars"), ...)
## S3 method for class 'summary.twinstim'
toLatex(object,
digits = max(3, getOption("digits")  3), eps.Pvalue = 1e4,
align = "lrrrr", booktabs = getOption("xtable.booktabs", FALSE),
withAIC = FALSE, ...)
## S3 method for class 'summary.twinstim'
xtable(x, caption = NULL, label = NULL,
align = c("l", "r", "r", "r"), digits = 3,
display = c("s", "f", "s", "s"), ...,
ci.level = 0.95, ci.fmt = "%4.2f", ci.to = "",
eps.Pvalue = 1e4)

x, object 
an object of class 
digits 
integer, used for number formatting with 
test.iaf 
logical indicating if the simple Wald z and pvalues
should be calculated for parameters of the interaction functions

correlation 
logical. If 
symbolic.cor 
logical. If 
runtime 
logical. If 
signif.stars 
logical. If 
eps.Pvalue 
passed to 
booktabs 
logical indicating if the 
withAIC 
logical indicating if the AIC and the loglikelihood of the model should be included below the table of coefficients in the LaTeX tabular. 
caption,label,align,display 
see 
ci.level,ci.fmt,ci.to 
the confidence intervals are calculated
at level 
... 
For 
The estimated coefficients and standard Waldtype confidence intervals
can be extracted using the default coef
and
confint
methods from package stats.
Note, however, that there is the useful coeflist
method to
list the coefficients by model component.
The print
and summary
methods allow the compact or comprehensive
representation of the fitting results, respectively. The former only prints
the original function call, the estimated coefficients and the maximum
loglikelihood value. The latter prints the whole coefficient matrix
with standard errors, z and pvalues (see printCoefmat
)
– separately for the endemic and the epidemic component – and
additionally the AIC, the achieved loglikelihood, the number of
loglikelihood and score evaluations, and the runtime.
They both append a big “WARNING”, if the optimization algorithm
did not converge.
The toLatex
method is essentially a
translation of the printed summary table of coefficients to LaTeX
code (using xtable). However, the xtable
method does a
different job in that it first converts coefficients to rate ratios
(RR, i.e., the exp
transformation) and gives confidence
intervals for those instead of standard errors and zvalues.
Intercepts and interaction function parameters are ignored by the
xtable
method.
The print
methods return their first argument, invisibly, as
they always should.
The vcov
method returns the estimated variancecovariance
matrix of the parameters, which is the inverse of
object$fisherinfo
(estimate of the expected Fisher
information matrix). This "fisherinfo"
is not always available
(see twinstim
), in which case
object$fisherinfo.observed
is used if available or an error is
returned otherwise.
The logLik
and nobs
methods return the maximum
loglikelihood value of the model, and the number of events (excluding
events of the prehistory), respectively.
The summary
method returns a list containing some summary
statistics of the model, which is nicely printed by the corresponding
print
method.
The toLatex
method returns a character vector of class
"Latex"
, each element containing one line of LaTeX code (see
print.Latex
).
The xtable
method returns an object of class
"xtable"
. Note that the column name of the confidence
interval, e.g. “95% CI”, contains the percent symbol that may
need to be escaped when printing the "xtable"
in the output
format (see sanitize.text.function
in
print.xtable
). This may also hold for row names.
Sebastian Meyer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30  # load a fit of the 'imdepi' data, see the example in ?twinstim
data("imdepifit")
# print method
imdepifit
# extract point estimates (in a single vector or listed by model component)
coef(imdepifit)
coeflist(imdepifit)
# variancecovariance matrix of endemic parameters
# (inverse of expected Fisher information)
unname(vcov(imdepifit)[1:4,1:4])
# the default confint() method may be used for Wald CI's
confint(imdepifit, parm="e.typeC", level=0.95)
# loglikelihood and AIC of the fitted model
logLik(imdepifit)
AIC(imdepifit)
nobs(imdepifit)
# produce a summary with parameter correlations and runtime information
(s < summary(imdepifit, correlation=TRUE, symbolic.cor=TRUE, runtime=TRUE))
# create LaTeX code of coefficient table
toLatex(s, withAIC=FALSE)
# or using the xtablemethod (which produces rate ratios)
xtable(s)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.