twinstim_update {surveillance} | R Documentation |
update
-method for "twinstim"
Description
Update and (by default) re-fit a "twinstim"
. This method is
especially useful if one wants to add the model
environment
(which is required for some methods) to a fitted model object a posteriori.
Usage
## S3 method for class 'twinstim'
update(object, endemic, epidemic,
control.siaf, optim.args, model,
..., use.estimates = TRUE, evaluate = TRUE)
Arguments
object |
a previous |
endemic , epidemic |
changes to the formulae – see
|
control.siaf |
a list (see |
optim.args |
see |
model |
see |
... |
Additional arguments to the call, or arguments with changed
values. |
use.estimates |
logical indicating if the estimates of
|
evaluate |
If |
Value
If evaluate = TRUE
the re-fitted object, otherwise the updated call.
Author(s)
Sebastian Meyer
Inspiration and some pieces of code originate from
update.default
by the R Core Team.
See Also
Examples
data("imdepi", "imdepifit")
## add another epidemic covariate
## (but fix siaf-parameter so that this example runs quickly)
imdepifit2 <- update(imdepifit, epidemic = ~. + log(popdensity),
optim.args = list(fixed="e.siaf.1"))
## compare by AIC
AIC(imdepifit, imdepifit2)