selSLSE {causalSLSE} | R Documentation |
Knots Selection Method
Description
This is the main function to select the knots in cslseModel
or
slseModel
objects. It returns a model with an optimal set of
knots.
Usage
## S3 method for class 'cslseModel'
selSLSE(model, selType=c("BLSE", "FLSE"),
selCrit = c("AIC", "BIC", "PVT"),
pvalT = function(p) 1/log(p),
vcovType = c("HC0", "Classical", "HC1", "HC2", "HC3"),
reSelect=FALSE, ...)
## S3 method for class 'slseModel'
selSLSE(model, selType=c("BLSE", "FLSE"),
selCrit = c("AIC", "BIC", "PVT"),
pvalT = function(p) 1/log(p),
vcovType = c("HC0", "Classical", "HC1", "HC2", "HC3"),
reSelect=FALSE, ...)
Arguments
model |
A model of class |
selType |
The selection method: backward ( |
selCrit |
The criterion to select the piecewise polynomial knots. |
pvalT |
A function to determine the p-value threshold for the significance of the coefficients. It has to be a function of one parameter, which is the average number of knots in the model. |
vcovType |
The type of least squares covariance matrix used to compute the p-values needed for the selection. |
reSelect |
By default, the stored selections are used. If
|
... |
Additional arguments to pass to other methods. Currently not used. |
Details
It selects the knots using one of the two methods, FLSE or BLSE, with
either the AIC, BIC or a p-value threshold (see the vignette for more
details). Any of these selection methods requires several least squares
estimations and it is performed only if the method has not been applied
yet and reSelect
is set to TRUE
. This is possible because
any new knots selection is saved into the returned model. A model may
have more than one selection saved into it. The active knots (the ones
used when we estimate the model) is stored into the element knots
of the model and the saved selections are stored into the element
selections
. See below for what is included in this element.
Note that the selections for the three criteria AIC, BIC and PVT are
computed and saved automatically in the returned model when
selCrit
is set to either "AIC"
or "BIC"
, because it
does not require many more operations to select them all once we do it
for AIC or BIC. However, it is only computed for PVT when selCrit
is set to "PVT"
.
The knots are selected jointly for all treatment groups in
cslseModel
objects. However, the active knots and all saved
selections are stored separately for each treatment group. For example,
the active knots for the treated in the cslseModel
object
mod
are stored in mod$treated$knots
. See the Vignette for
more details.
Value
The method returns an object of class slseModel
or
cslseModel
depending on which object it is applied
to. When it does not already exist, the element selections
is added
to the slseModel
object (or to each slseModel
object in
cslseModel
objects). The element selections
is a list with
one or more of the following elements:
originalKnots |
The original knots as selected initially by
|
FLSE , BLSE |
This is where selections based on the forward (FLSE) and the backward (BLSE) methods are stored. |
Finally, BLSE
and FLSE
are lists that may contain the following elements:
AIC , BIC |
A list of integer vectors, one for each covariate in the
|
PVT |
Same as the AIC and BIC, but the selection is based on a p-value threshold. |
JAIC , JBIC |
This criteria is for |
Threshold |
The p-value threshold used for the PVT criterion. |
pval |
A list of p-values, one for each original knots. See vignette for a definition of the p-values. |
See Also
slseModel
and cslseModel
for model
objects description and update
for
ways of selecting stored selections
Examples
data(simDat3)
mod1 <- cslseModel(Y~Z|~X1*X2, data=simDat3)
mod1 <- selSLSE(mod1, selType="FLSE", selCrit="AIC")
## The following does not require additional computation
## because the selection is stored in mod1
mod1 <- selSLSE(mod1, selType="FLSE", selCrit="BIC")
## But the following does
mod1 <- selSLSE(mod1, selType="BLSE", selCrit="BIC")
## See one selection:
mod1$treated$selections$BLSE$JBIC