node_plot {rpms} | R Documentation |
node_plot
Description
plots end-node of object of class rpms
Usage
node_plot(object, node, data, variable = NA, ...)
Arguments
object |
|
node |
integer label of the desired end-node. |
data |
data.frame that includes variables used in rp_equ, e_equ, and design information |
variable |
string name of variable in data to use as x-axis in plot |
... |
further arguments passed to plot function. |
Examples
{
# model mean of retirement account value for households with reported
# retirment account values > 0 using a binary tree while accounting for
# clusterd data and sample weights.
s1<- which(CE$IRAX > 0)
r1 <-rpms(IRAX~EDUCA+AGE+BLS_URBN, data = CE[s1,], weights=~FINLWT21, clusters=~CID)
# plot node 6 if it is an end-node of the tree
if(6 %in% end_nodes(r1))
node_plot(object=r1, node=6, data=CE[s1,])
# plot node 6 if it is an end-node of the tree
if(8 %in% end_nodes(r1))
node_plot(object=r1, node=8, data=CE[s1,])
}
[Package rpms version 0.5.1 Index]