| depsubtree | R Documentation |
Extract the dependency subtree of a staged tree with respect to a variable
depsubtree(object, var, other_stages = c("NA", "indep", "full"))
object |
an object of class |
var |
the name of one of the variable of the staged event tree. |
other_stages |
how to set stages for other variables (if any). |
The dependency sub-tree is a staged event tree which is
sufficient to describe the conditional distribution of the variable
var given its predecessors in the original tree represented by
object.
In particular the preceding variables are restricted to the
parents of var in the minimal-DAG obtained with
as_parentslist. This is the minimal set of
variables which contexts are sufficient to fully represent the
conditional distribution of var.
Stages for variables different from var are either set to
NA, or to the full or indep model, depending on other_stages.
an object of class sevt representing the
dependency sub-tree.
mod <- stages_kmeans(full(Titanic), k = 2)
par(mfrow = c(1, 2))
plot(mod, main = "staged tree")
plot(depsubtree(mod, "Age"), main = "dependency subtree for Age")
par(mfrow = c(1, 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.