twinstim_update | R Documentation |
update
-method for "twinstim"
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.
## S3 method for class 'twinstim'
update(object, endemic, epidemic,
control.siaf, optim.args, model,
..., use.estimates = TRUE, evaluate = TRUE)
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 |
If evaluate = TRUE
the re-fitted object, otherwise the updated call.
Sebastian Meyer
Inspiration and some pieces of code originate from
update.default
by the R Core Team.
update.default
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.