Learn R Programming

rpms (version 0.2.0)

in_node: in_node

Description

Get index of elements in dataframe that are in the specified end-node of an rpms object

Usage

in_node(node, t1, data)

Arguments

node

integer label of the desired end-node.

t1

rpms object

data

dataframe containing the variables used for the recursive partitioning.

Value

vector of indexes for observations in the end-node.

Examples

Run this code
# model linear fit between retirement contributions and amount of income 
r1 <-rpms(FINDRETX~EDUC_REF+AGE_REF+BLS_URBN+REGION, data=CE,
     e_equ=FINDRETX~FINCBTAX, clusters=~CID) 

if(2 %in% end_nodes(r1))
  summary(CE$FSALARYX[in_node(node=2, r1, data=CE)])

if(6 %in% end_nodes(r1))
  summary(CE$FSALARYX[in_node(node=6, r1, data=CE)])

Run the code above in your browser using DataLab