stPrint {splinetree} | R Documentation |
Print a spline tree in the style of print.rpart
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
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
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)
[Package splinetree version 0.2.0 Index]