BART Procedure

MARGIN Statement

  • MARGIN 'name' variable='value' <…variable = 'value' > </ LABEL='label'>;

The MARGIN statement computes a predictive margin (Lane and Nelder 1982). A predictive margin is obtained by fixing the value of one or more input variables and averaging the predicted response values over the distribution of covariates in an input data table.

The elements of the MARGIN statement are as follows:

name

identifies the predictive margin. The name is used in output tables, to specify event and reference levels in a MARGINDIFF statement, and to name variables in an output data table that is created by a OUTPUTMARGIN statement.

variable = 'value'

identifies an input variable and the value that it is set to when you compute the predictive margin. The variable can be either continuous or categorical. For a categorical variable, you must specify the value in quotes. You can specify multiple input variables and the values that they are set to when computing the predictive margin.

In addition to the required name for the predictive margin, you can provide an optional label that is displayed in output tables when you specify the LABEL= option after a slash (/).

If you specify both the MARGIN and MODEL statements, then the predictive margins are computed by averaging the predictions from the fitted model for all observations in the training data. If you specify the MARGIN statement and the RESTORE= option in the PROC BART statement, then the predictive margins are computed by averaging the predictions from the previously fitted model that is saved in the specified analytic store for all observations in the input data table that you specify in the DATA= option in the PROC BART statement. For more information about using a previously fitted model to score and compute predictive margins, see Example 4.1: Storing and Scoring.

Last updated: May 14, 2026