backward {CoCoRaw} | R Documentation |
This function perform (depth first) search for a single model with all edges or interaction terms significant (backward), or all terms not in the model not significant (forward). The function can also be used to compute tests for all terms in the model or all terms not in the model.
backward(sorted = FALSE, reversed = FALSE, only = FALSE, short = FALSE, p.accepted = FALSE, p.rejected = FALSE, decomposable.mode = NULL, coherent = FALSE, headlong = FALSE, recursive = FALSE, follow = FALSE, least.significant = TRUE, components = NULL, p.components = FALSE, separators = FALSE, p.separators = FALSE, edges = TRUE, model = FALSE, fix.edges = NULL, return.tests = FALSE, data = NULL, object = .object.of.model(model, data = data, ...), ...) forward(sorted = FALSE, reversed = FALSE, only = FALSE, short = FALSE, p.accepted = FALSE, p.rejected = FALSE, decomposable.mode = NULL, coherent = FALSE, headlong = FALSE, recursive = FALSE, all.significant = TRUE, components = NULL, p.components = FALSE, separators = FALSE, p.separators = FALSE, edges = TRUE, model = FALSE, fix.edges = NULL, return.tests = FALSE, data = NULL, object = .object.of.model(model, data = data, ...), ...)
sorted |
Logical, if sorted is TRUE
then a list of tests is printed
sorted according to the selected
p-value (statistic, if IC is selected).
For backward the p-values are ordered in
increasing order (IC decreasing),
and for forward the p-values are ordered in
decreasing order (IC increasing).
The least significant edge is then last for backward,
and the most significant edge is then last for forward.
|
reversed |
Logical, if reversed is TRUE then
the sorted list is printed in reverse order. |
only |
Logical, if only is TRUE then only
the sorted list is printed. |
short |
Logical, if short is TRUE then only a short report
is printed: The test of the edge removed (entered) at
each cycle.
If short is TRUE and dump
(optionsCoCo ) also is TRUE
then for each completed set of backward (e.i. each removal
of an edge or interaction terms), the dump file is rewinded,
and a report of rejected, accepted, eligible terms
and the model resulting of the step is printed on the file.
In the following step of the backward elimination each tested
term and the selected test statistic for the test of the term
is printed on the dump file. Similar for forward.
|
p.accepted |
Numeric, edges and interaction terms with tests with
p-value (or minus the IC value)
greater than p.accepted are accepted
for removal in backward.
If coherent is TRUE for
forward then terms with
p-value (or minus the IC value)
greater than p.accepted are not
eligible for entering in sub sequential
cycles of the forward selection.
|
p.rejected |
Numeric, and interaction terms with tests with
p-value (or minus the IC value)
smaller than p.rejected are rejected,
and thus entered into the model in forward
(according to all.significant ).
If coherent is TRUE for
backward then terms with
p-value (or minus the IC value)
smaller than p.rejected are not
eligible for removal in sub sequential
cycles of the backward elimination.
|
decomposable.mode |
Logical, if decomposable.mode is TRUE
then only decomposable models are visited. |
coherent |
Logical, if coherent then the principle of
coherence is applied: Once an edge in backward (forward)
is rejected (accepted) it is no more tested for
removal (entering).
|
headlong |
Logical, if headlong is TRUE then in each cycle,
e.i. visiting of the edges or interaction terms of the
model, terms are only visited until a term is found
to remove or enter.
In backward edges are visited until an edge with
a p-value (or minus the IC value)
greater than p.accepted is found,
and in forward edges are visited until an edge with
a p-value (or minus the IC value)
smaller than p.rejected is found.
|
recursive |
Logical, if recursive is TRUE then cycles
of visiting edges or interaction terms are repeated
until no more edges are removed in backward
and until no more edges are added in forward. |
follow |
Logical, if follow is TRUE then tests in backward
are performed against the model selected in the previous
cycle, else tests are performed against the BASE model.
The option is not available for forward. |
least.significant |
Logical, if least.significant is TRUE then
the least significant edge is removed in backward,
else all non significant edges are removed.
The option is not available for forward. |
all.significant |
Logical, if all.significant is TRUE then
all significant edges are entered in forward,
else only the most significant edge is entered.
The option is not available for backward. |
components |
Logical, if components is TRUE,
then common decompositions of the two models
of each tests are found.
If any p-value (or minus the IC value) of
the tests on the resulting components is less than
p.components then the test is rejected. |
p.components |
Numeric, edges
with a p-value (or minus the IC value)
less than the value p.components
for any component
is rejected, if components is TRUE. |
separators |
Logical, if separators is TRUE, then for each
edge all separators of the two vertices of the edge
is found, and the edge is rejected, if for any of
these separators the two variables not are conditional
independent, determined by p.separators . |
p.separators |
Numeric, edges
with a p-value (or minus the IC value)
less than the value p.separators
for any separator
is rejected, if separators is TRUE. |
edges |
Logical, if edges is TRUE, then in each cycle
edges of the model are visited, else the maximal interaction
terms are visited. |
model |
See returnModel . |
fix.edges |
A character string with a generating class.
Edges in fix.edges are not eligible for removal
in backward, and are not eligible for entering in forward.
if fix.edges is NULL, default, the fixing of the
previous backward or forward is retained.
Use fix.edges = "" to clear fixing of edges.
|
return.tests |
Logical, if return.tests is TRUE
then the test values are returned in a matrix.
(recursive should be FALSE.) |
data |
See exportCoCo . |
object |
See exportCoCo . |
... |
Additional arguments to generate the CoCo object
from the data argument. See propertyModel . |
TRUE
Note also the options of the sections "tests"
(optionsCoCo
).
p.accepted
, p.rejected
, p.components
,
p.separators
when set to a value not FALSE
will set these options for the CoCo object.
If the arguments are not given to backward and forward
the the values of the CoCo objects will be used.
The arguments decomposable.mode
and separators
when different from NULL sets respectively the
options decomposable.mode
and partitioning
.
Note that to use BIC
both IC
and BIC
has to be set to TRUE, since IC
controls
whether to use p-values or IC-values,
and BIC
controls which IC-value to use.
Jens Henrik Badsberg
Badsberg, J.H.: A guide to CoCo, JSS, 2001 ( http://www.jstatsoft.org/v06/i04/ ) and Badsberg, J.H.: Xlisp+CoCo, Aalborg University, 1996.