1. Home
  2. BRKEEP procedure

BRKEEP procedure

Saves information from a regression tree (R.W. Payne).

No options

Parameters

TREE = trees Tree from which the information is to be saved
SUMMARY = variates Saves summary information about each tree
XVARIABLES = pointers Saves the identifiers of the x-variables in each tree

Description

BRKEEP saves information about a regression tree, constructed by the BREGRESSION procedure. The tree can be saved using the TREE option of BREGRESSION, and is specified for BRKEEP using its TREE parameter.

The SUMMARY parameter saves a variate containing summary information: number of nodes, number of terminal nodes, residual sum of squares, residual degrees of freedom, residual mean square and percentage variance accounted for (in that order).

The XVARIABLES parameter saves a pointer containing the identifiers of the x-variables in the tree.

Options: none.

Parameters: TREE, SUMMARY, XVARIABLES.

See also

Procedures: BREGRESSION, BRDISPLAY, BRPREDICT.

Commands for: Regression analysis, Multivariate and cluster analysis.

Example

CAPTION 'BRKEEP example',!t('Water usage data (Draper & Smith 1981,',\
      'Applied Regression Analysis, Wiley, New York).'); STYLE=meta,plain
READ  temp,product,opdays,employ,water
58.8  7.107 21 129 3.067
65.2  6.373 22 141 2.828
70.9  6.796 22 153 2.891
77.4  9.208 20 166 2.994
79.3 14.792 25 193 3.082
81.0 14.564 23 189 3.898
71.9 11.964 20 175 3.502
63.9 13.526 23 186 3.060
54.5 12.656 20 190 3.211
39.5 14.119 20 187 3.286
44.5 16.691 22 195 3.542
43.6 14.571 19 206 3.125
56.0 13.619 22 198 3.022
64.7 14.575 22 192 2.922
73.0 14.556 21 191 3.950
78.9 18.573 21 200 4.488
79.4 15.618 22 200 3.295 :
"form the regression tree"
BREGRESSION [PRINT=*; Y=water; TREE=tree] employ,opdays,product,temp
"prune the tree"
BPRUNE      [PRINT=table] tree; NEWTREES=pruned
"use tree 6 - renumber nodes"
BCUT        [RENUMBER=yes] pruned[6]; NEWTREE=tree
"display the tree"
BRDISPLAY   [PRINT=summary,indented] tree
" save information "
BRKEEP      tree; SUMMARY=summ; XVARIABLES=xvar
PRINT       summ; DECIMALS=4
PRINT       xvar
Updated on March 8, 2019

Was this article helpful?