The CAUSALTRT Procedure

PSMODEL Statement

  • PSMODEL treatment <(variable-options)><= effects </ psmodel-options>>;

For all the estimation methods that PROC CAUSALTRT implements, you must specify a treatment variable in a PSMODEL statement. The regression model that is fit by the PSMODEL statement is called the propensity score model. The propensity score refers to the probability of receiving treatment conditional on the model effects. For more information about the estimation methods that PROC CAUSALTRT implements, see the section Estimating the Average Treatment Effect (ATE).

In addition to specifying the treatment variable, you can also specify the following:

effects

specify one or more explanatory variables or a combination of variables that are used to fit a regression model for the treatment variable. Explanatory variables that represent nominal (classification) data must be declared in the CLASS statement. For more information about specifying effects, see the section Specification of Effects in Chapter 53, The GLM Procedure.

variable-options

specify one or more of the following options within parentheses for after the treatment variable:

DESCENDING
DESC

reverses the order of the treatment categories. If both the DESCENDING and ORDER= options are specified, PROC CAUSALTRT orders the treatment categories according to the ORDER= option and then reverses that order.

EVENT='category' | FIRST | LAST

specifies the event category for the binary treatment model. PROC CAUSALTRT models the probability of the event category. You can specify one of the following:

'category'

specifies the value (formatted if a format is applied) of the event category in quotation marks.

FIRST

designates the first-ordered category as the event.

LAST

designates the last-ordered category as the event.

By default, EVENT=FIRST.

One of the most common sets of treatment levels is {0,1}, where 1 represents the event for which the probability is to be modeled. Consider the following example, where T takes the values 1 and 0 for event and nonevent, respectively, and X is the explanatory variable. To specify the value 1 as the event category, use the following PSMODEL statement:

psmodel T(event='1') = X;
ORDER=DATA | FORMATTED | FREQ | INTERNAL

specifies the sort order for the levels of the treatment variable. The following table displays the available ORDER= options.

ORDER= Levels Sorted By
DATA Order of appearance in the input data set.
FORMATTED External formatted value, except for numeric variables that have no explicit format, which are sorted by their unformatted (internal) value. The sort order is machine-dependent.
FREQ Descending frequency count. Levels that have the most observations come first in the order.
INTERNAL Unformatted value. The sort order is machine-dependent.

By default, ORDER=FORMATTED.

For more information about sort order, see the chapter on the SORT procedure in the Base SAS Procedures Guide and the discussion of BY-group processing in SAS Programmers Guide: Essentials.

REFERENCE='category' | FIRST | LAST
REF='category' | FIRST | LAST

specifies the reference category for the binary treatment model. Specifying one treatment category as the reference is the same as specifying the other treatment category as the event category. You can specify one of the following:

'category'

specifies the value (formatted if a format is applied) of the reference category in quotation marks.

FIRST

designates the first-ordered category as the reference.

LAST

designates the last-ordered category as the reference.

By default, REF=LAST.

psmodel-options

specify additional options for the propensity score model after a slash (/). These psmodel-options are summarized in Table 7 and described in detail after the table. These options are applied only if the estimation method you request requires fitting a propensity score model.

Table 7: psmodel-options in the PSMODEL Statement

Option Description
ALPHA= Specifies the level for confidence limits
PLOTS= Produces graphics for the propensity scores and weights
WGTFLAG= Specifies a value to be used to flag large weights


ALPHA=number

specifies a number to use as the alpha level for 100 left-parenthesis 1 minus alpha right-parenthesis% confidence limits that the PSMODEL statement computes. The value of number must be between 0 and 1. The default value of number is the set by the ALPHA= option in the PROC CAUSALTRT statement.

PLOTS <(global-plot-options)>=plot-request<(options)>
PLOTS <(global-plot-options)>=(plot-request <(options)> <…plot-request <(options)>>)

produces ODS graphics by using the predicted propensity scores. No graphics are produced if you specify the PLOTS=NONE option in the PROC CAUSALTRT statement or if the estimation method used does not require fitting a propensity score model.

ODS Graphics must be enabled before plots can be requested. For example:

ods graphics on;

proc causaltrt method=ipwr;
   model y;
   psmodel trt = x1 x2 /plots=all;
run;

ods graphics off;

For more information about enabling and disabling ODS Graphics, see the section Enabling and Disabling ODS Graphics in Chapter 24, Statistical Graphics Using ODS.

You can specify the following plot-requests:

ALL

produces all possible plots.

LOGITPSCORE
LPS

produces overlaid density plots for the logit of the propensity score within each treatment condition.

NONE

suppresses all plots that the PSMODEL statement could produce. This plot-request is used to suppress output if the PLOTS=ALL option is specified in the PROC CAUSALTRT statement.

OUTBYPSCORE
OUTBYPS

produces a scatter plot of the outcome variable by the propensity score for nonbinary outcomes. If the outcome is binary, box plots of the propensity scores within treatment conditions are produced for each outcome level. The whisker lengths for each box plot are determined by the maximum and minimum of the propensity scores.

OUTBYWEIGHT
OUTBYWGT

produces a scatter plot of the outcome variable by weight for nonbinary outcomes. If the outcome is binary, box plots of the weights within treatment conditions are produced for each outcome level. The whisker lengths for each box plot are determined by the maximum and minimum of the weights.

PSCLOUD

produces a point cloud of the propensity scores by jittering within the control and treatment conditions.

PSCOVDEN<pscovden-options>

produces density plots for the covariates or continuous effects that are specified in the PSMODEL statement. Each plot displays the density of effects for the treatment and control condition. Two plots are produced for each effect: one plot displays unweighted densities, and the other plot displays densities that are weighted by inverse probability weights. By default, plots are produced for all continuous effects that are specified in the PSMODEL statement, and the plots are collected in panels. You can specify the following pscovden-options:

EFFECTS(effects)

specifies the effects for which density plots are produced. Plots are produced only for continuous effects that are specified in the PSMODEL statement. The effects consist of an explanatory variable or combination of variables. The syntax for specifying effects in this option is the same as the syntax for specifying effects in the MODEL and PSMODEL statements.

UNPACK

suppresses paneling. By default, multiple plots can appear in the same output panel. You can use this option to display each plot separately.

UNPACKEFFECTS

creates a separate panel for each effect. Each panel has a single row and two columns that contain the unweighted and weighted density plots. This option is ignored if you specify the UNPACK option in the PROC CAUSALTRT or PSMODEL statements.

PSDIST

produces a box plot of the propensity scores for each treatment condition. The whisker lengths for each box plot are determined by the maximum and minimum of the propensity scores.

WEIGHTCLOUD
WCLOUD

produces a point cloud of the weights by jittering within the control and treatment conditions.

WEIGHTDIST
WDIST

produces a box plot of the weights for each treatment condition. The whisker lengths for each box plot are determined by the maximum and minimum of the weights.

You can specify the following global-plot-options:

ONLY

suppresses plots that are not specified as a plot-request. This option applies only if the PLOTS= option is specified in the PROC CAUSALTRT statement.

UNPACK
UNPACKPANEL

suppresses paneling. By default, multiple plots can appear in the same output panel. You can specify UNPACK to display each plot separately.

WGTFLAG=number

specifies a number to use to flag large weights. The value of number must be greater than or equal to 1. If any observations have weights greater than number, a note is added to the SAS log. By default, WGTFLAG=50.

Last updated: December 09, 2022