![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
Contents: | Purpose / History / Requirements / Usage / Details / Limitations / Missing Values / See Also / References |
Version | Update Notes |
1.7 | Fixed row labeling when CONTRAST= option is specified. |
1.6 | Removed computation of estimated correlations to avoid problems with use of intercept-only model. Fix to automatic check for new version. |
1.5 | Fixed subscript error in RNAME with 15 or more data sets and XBETA variables. Added automatic check for new version. |
1.4 | Corrected errors with default contrast and only one variable specified in VAR=. The single area is now estimated and tested. |
1.3 | Added confidence intervals for each area. Added ALPHA= parameter to control confidence level. Default contrasts are now all pairwise differences. Added table of confidence intervals and tests of each contrast row. |
1.2 | Put original author's code in macro form. Allow input of several data sets to compare several models which may each have multiple predictors. Default contrast set generated. Added DETAILS= parameter to minimize default output. Creates macro variable with overall p-value. |
%inc "<location of your file containing the ROC macro>";
Following this statement, you may call the %ROC macro. See the Results tab for examples.
You must first run the LOGISTIC procedure to fit each of the the models whose ROC curves are to be compared. Each model must be fit to exactly the same data set (with observations in the same order) and they must all be fit to the same response variable. The ROC macro requires that the response variable have only values of 0 and 1 even though this is not a restriction necessary for PROC LOGISTIC. Specify the EVENT="1" option in parentheses following the response variable name in the MODEL statement. Use the XBETA= or PRED= option in the OUTPUT statement in each run of LOGISTIC. The output data set names must be unique. Since the XBETA= or PRED= output variables are used to identify and compare the models' ROC curves, the names must be unique and it is recommended that you select a name for each variable that adequately identifies the fitted model.
The following macro parameters can be specified. The DATA, VAR=, and RESPONSE= parameters are required.
%str()
. An L
matrix with
more than one row may be specified by using commas to separate the rows
of coefficients. If omitted, a default contrast testing the equality of
all ROC curve areas jointly and pairwise is used.
The version of the %ROC macro that you are using is displayed when you specify version (or any string) as the first argument. For example:
%roc(version, data=a b, var=xba xbb, response=y)
Note that ROC curves from models fit to two or more independent groups of observations are not dependent and therefore cannot be compared using these methods. The SEE ALSO section below refers to an appropriate method for comparing independent curves.
The ROC macro assigns a name to each table it creates. You can use these names to reference the table when using the Output Delivery System (ODS) to select or exclude tables and to create output data sets. The table names are listed in the following table along with any macro parameters required to make the table available. When outputting a table to a data set, you can determine the names of variables in the data set by using PROC CONTENTS.
ODS table name | Description | %ROC macro option |
T | Pairwise deletion Mann-Whitney Statistics | DETAILS=yes |
V | Estimated Variance Matrix | DETAILS=yes |
NX | X populations sample sizes | DETAILS=yes |
NY | Y populations sample sizes | DETAILS=yes |
L | Coefficients of Contrast | default |
LT | Estimates of Contrast | default |
LV | Variance Estimates of Contrast | DETAILS=yes |
AREASTAB | ROC Area Std Error Confidence Limits | default |
DIFFSTAB | Tests and 100(1-α)% Confidence Intervals for Contrast Rows | default |
CTEST | Contrast Test Results | default |
In addition to displayable output, the ROC macro creates a macro variable, pvalue, containing the p-value from the test of joint equality of ROC curve areas.
Macro Updates
The %ROC macro attempts to check for a later version of itself. If it is unable to do this (such as if there is no active internet connection available), the macro will issue the following message:
ROC: Unable to check for newer version
The computations performed by the macro are not affected by the appearance of this message.
See this note on comparing the areas under independent ROC curves.
Puri M.L and Sen P.K. (1971), Nonparametric Methods in Multivariate Analysis, Wiley.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.