R rpms
rpms is an implementation of decision trees and random forests for R.
Installation
install.packages('rpms')
Usage
tree <- rpms(rp_equ=y ~ va + vb + vc, data=data)
Partitions are determined through randomized permutation and hypothesis tests.
Options for Complex Survey Design
The hypothesis tests used in this package support complex survey designs.
tree <- rpms(rp_equ=y ~ va + vb + vc, data=data, weights=~wtvar, strata=~stratavar, cluster=~clustervar)
Given clusters, the trees are permuted in a 2 step algorithm: first across clusters and then within clusters. This algorithm does not perform well when the clusters are significantly varying in (effective) size.
Trees
See above examples for usage.
To plot a specific partition, try:
node_plot(object=tree, node=1, data=data)
The qtree function translates a tree into LaTeX markup, for inclusion in a report.
Random Forests
tree <- rpms(rp_equ=y ~ va + vb + vc, data=data)
Uniformly random trees are generated, and then aggregated as a weighted average. The trees are weighted by inverse variance.
