Provides a similar output to model$frame, but with the redundant information of yval and yval2 removed. Also omits the deviance, the complexity, and the weight. Useful for viewing node numbers and for extracting coefficients for a given node.

treeSummary(model)

Arguments

model

A model built with splineTree()

Value

A dataframe. The number of rows is the same as the number of nodes in the tree. The row names display the node labels of each node. The "var" attribute either displays the split variable selected at each node, or <leaf> if this node is a terminal node. The "n" attribute displays the number of individuals in the node. The "dev" attribute reports the projected sum of squares at this node; terminal nodes have the smallest values for "dev" because this is what the tree building process is supposed to minimize. The "coeffs" attribute displays the coefficients predicted for each node.

Examples

nlsySubset <- nlsySample[nlsySample$ID %in% sample(unique(nlsySample$ID), 400),] split_formula <- ~HISP + WHITE + BLACK + SEX + Num_sibs + HGC_FATHER + HGC_MOTHER tree <- splineTree(split_formula, BMI~AGE, idvar = "ID", data = nlsySubset, degree = 1, df = 3, intercept = TRUE, cp = 0.005)
treeSummary(tree)
#> var n dev coeffs.1 coeffs.2 coeffs.3 #> 1 HGC_MOTHER 400 64450.4439 21.393698 5.003756 8.032485 #> 2 HGC_FATHER 114 27795.0601 21.590622 6.830836 9.698794 #> 4 <leaf> 25 7355.1108 23.471714 7.973191 8.979239 #> 5 Num_sibs 89 18985.2254 21.062226 6.509950 9.900916 #> 10 <leaf> 14 951.9451 20.366114 3.182837 6.884965 #> 11 Num_sibs 75 16622.1721 21.192166 7.131011 10.463894 #> 22 HGC_FATHER 43 11430.4577 22.500530 6.528283 10.573071 #> 44 <leaf> 26 9340.0127 23.252525 7.034976 11.486118 #> 45 <leaf> 17 1367.1894 21.350422 5.753342 9.176645 #> 23 HGC_MOTHER 32 4572.0868 19.434052 7.940926 10.317188 #> 46 <leaf> 12 1235.4147 20.179409 5.402133 6.772917 #> 47 <leaf> 20 2950.8757 18.986838 9.464202 12.443751 #> 3 SEX 286 33299.9476 21.315204 4.275479 7.368292 #> 6 <leaf> 156 13203.6442 22.089508 4.049237 6.798008 #> 7 HGC_FATHER 130 19390.7995 20.386038 4.546969 8.052632 #> 14 <leaf> 17 3145.0034 20.720018 6.382532 7.685711 #> 15 BLACK 113 15912.3913 20.335793 4.270823 8.107833 #> 30 Num_sibs 85 10824.7490 19.987021 4.168940 7.665536 #> 60 <leaf> 41 4567.8368 20.880103 4.222726 7.554083 #> 61 <leaf> 44 5796.7687 19.154830 4.118821 7.769390 #> 31 <leaf> 28 4491.2508 21.394566 4.580110 9.450518