sevt_add {stagedtrees} | R Documentation |
Add a variable to a staged event tree
Description
Return an updated staged event tree with one additional variable at the end of the tree.
Usage
sevt_add(object, var, data, join_unobserved = TRUE, useNA = "ifany")
Arguments
object |
an object of class |
var |
character, the name of the new variable to be added. |
data |
either a |
join_unobserved |
logical, passed to |
useNA |
whether to include NA values in the tables.
Argument passed to |
Details
This function update a staged event tree object with an additional variable. The stages structure of the new variable is initialized as in the saturated model.
Value
An object of class sevt
representing a
staged event tree model with var
added as last variable.
Examples
model <- full(Titanic, order = c("Age", "Class"))
print(model)
model <- sevt_add(model, "Survived", Titanic)
print(model)
[Package stagedtrees version 2.3.0 Index]