stPrint: Print a spline tree in the style of print.rpart

Description Usage Arguments Examples

View source: R/tree_print.R

Description

The printout provides numbered labels for the terminal nodes, a description of the split at each node, the number of observations found at each node, and the predicted spline coefficients for each node. This code is primarily taken from rpart base code for print.rpart. It has been modified to ensure that the full vector of coefficients is printed for each node.

Usage

1
stPrint(t, cp, digits = getOption("digits"))

Arguments

t

A model returned by splineTree()

cp

Optional- if provided, a pruned version of the tree will be printed. The tree will be pruned using the provided cp as the complexity parameter.

digits

Specifies how many digits of each coefficient should be printed

Examples

1
2
3
4
5
6
split_formula <- ~HISP + WHITE + BLACK + SEX + Num_sibs + HGC_FATHER + HGC_MOTHER
tree <- splineTree(split_formula, BMI~AGE, idvar = "ID",
   data = nlsySample, degree = 1, df = 3,
   intercept = TRUE, cp = 0.005)

stPrint(tree)

splinetree documentation built on July 18, 2019, 9:08 a.m.