twinstim_step | R Documentation |
stepComponent
is a wrapper around step
to select a
"twinstim"
component's model based on an information
criterion in a stepwise algorithm.
There are also stand-alone single-step methods of add1
and
drop1
.
stepComponent(object, component = c("endemic", "epidemic"),
scope = list(upper = object$formula[[component]]),
direction = "both", trace = 2, verbose = FALSE, ...)
## S3 method for class 'twinstim'
add1(object, scope, component = c("endemic", "epidemic"),
trace = 2, ...)
## S3 method for class 'twinstim'
drop1(object, scope, component = c("endemic", "epidemic"),
trace = 2, ...)
object |
an object of class |
component |
one of |
scope , direction , trace |
see |
verbose |
see |
... |
further arguments passed to |
See step
and add1
, respectively.
(of this wrapper around step
) Sebastian Meyer
step
, add1
, drop1
data("imdepi", "imdepifit")
## simple baseline model
m0 <- update(imdepifit, epidemic=~1, siaf=NULL)
## AIC-based step-wise backward selection of the endemic component
m0_step <- stepComponent(m0, "endemic", scope=list(lower=~I(start/365-3.5)))
## nothing is dropped from the model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.