The PHREG Procedure

CONTRAST Statement

  • CONTRAST 'label' row-description <, …row-description> </ options>;

The CONTRAST statement provides a mechanism for obtaining customized hypothesis tests. It is similar to the CONTRAST statement in PROC GLM and PROC CATMOD, depending on the coding schemes used with any categorical variables involved.

The CONTRAST statement enables you to specify a matrix, bold upper L, for testing the hypothesis bold upper L bold-italic beta equals bold 0. You must be familiar with the details of the model parameterization that PROC PHREG uses (for more information, see the PARAM= option in the section CLASS Statement). Optionally, the CONTRAST statement enables you to estimate each row, bold-italic l prime Subscript i Baseline bold-italic beta, of bold upper L bold-italic beta and test the hypothesis bold-italic l prime Subscript i Baseline bold-italic beta equals 0. Computed statistics are based on the asymptotic chi-square distribution of the Wald statistic.

There is no limit to the number of CONTRAST statements that you can specify, but they must appear after the MODEL statement.

The syntax of a row-description is:

effect values <,…,effect values>

The following parameters are specified in the CONTRAST statement:

label

identifies the contrast on the output. A label is required for every contrast specified, and it must be enclosed in quotes.

effect

identifies an effect that appears in the MODEL statement. You do not need to include all effects that are included in the MODEL statement.

values

are constants that are elements of the bold upper L matrix associated with the effect. To correctly specify your contrast, it is crucial to know the ordering of parameters within each effect and the variable levels associated with any parameter. The "Class Level Information" table shows the ordering of levels within variables. The E option, described later in this section, enables you to verify the proper correspondence of values to parameters.

The rows of bold upper L are specified in order and are separated by commas. Multiple degree-of-freedom hypotheses can be tested by specifying multiple row-descriptions. For any of the full-rank parameterizations, if an effect is not specified in the CONTRAST statement, all of its coefficients in the bold upper L matrix are set to 0. If too many values are specified for an effect, the extra ones are ignored. If too few values are specified, the remaining ones are set to 0.

When you use effect coding (by specifying PARAM=EFFECT in the CLASS statement), all parameters are directly estimable (involve no other parameters). For example, suppose an effect coded CLASS variable A has four levels. Then there are three parameters (alpha 1 comma alpha 2 comma alpha 3) representing the first three levels, and the fourth parameter is represented by

minus alpha 1 minus alpha 2 minus alpha 3

To test the first versus the fourth level of A, you would test

alpha 1 equals minus alpha 1 minus alpha 2 minus alpha 3

or, equivalently,

2 alpha 1 plus alpha 2 plus alpha 3 equals 0

which, in the form bold upper L bold-italic beta equals 0, is

Start 1 By 3 Matrix 1st Row 1st Column 2 2nd Column 1 3rd Column 1 EndMatrix Start 3 By 1 Matrix 1st Row  alpha 1 2nd Row  alpha 2 3rd Row  alpha 3 EndMatrix equals 0

Therefore, you would use the following CONTRAST statement:

contrast '1 vs. 4' A 2 1 1;

To contrast the third level with the average of the first two levels, you would test

StartFraction alpha 1 plus alpha 2 Over 2 EndFraction equals alpha 3

or, equivalently,

alpha 1 plus alpha 2 minus 2 alpha 3 equals 0

Therefore, you would use the following CONTRAST statement:

contrast '1&2 vs. 3' A 1 1 -2;

Other CONTRAST statements involving classification variables with PARAM=EFFECT are constructed similarly. For example:

contrast '1 vs. 2    '  A  1 -1  0;
contrast '1&2 vs. 4  '  A  3  3  2;
contrast '1&2 vs. 3&4'  A  2  2  0;
contrast 'Main Effect'  A  1  0  0,
                        A  0  1  0,
                        A  0  0  1;

When you use the less-than-full-rank parameterization (by specifying PARAM=GLM in the CLASS statement), each row is checked for estimability. If PROC PHREG finds a contrast to be nonestimable, it displays missing values in corresponding rows in the results. PROC PHREG handles missing level combinations of categorical variables in the same manner as PROC GLM. Parameters corresponding to missing level combinations are not included in the model. This convention can affect the way in which you specify the bold upper L matrix in your CONTRAST statement. If the elements of bold upper L are not specified for an effect that contains a specified effect, then the elements of the specified effect are distributed over the levels of the higher-order effect just as the GLM procedure does for its CONTRAST and ESTIMATE statements. For example, suppose that the model contains effects A and B and their interaction A*B. If you specify a CONTRAST statement involving A alone, the bold upper L matrix contains nonzero terms for both A and A*B, since A*B contains A.

The Cox model contains no explicit intercept parameter, so it is not valid to specify one in the CONTRAST statement. As a consequence, you can test or estimate only homogeneous linear combinations (those with zero-intercept coefficients, such as contrasts that represent group differences) for the GLM parameterization.

The degrees of freedom are the number of linearly independent constraints implied by the CONTRAST statement—that is, the rank of bold upper L.

You can specify the following options after a slash (/).

ALPHA= p

specifies the level of significance p for the 100 left-parenthesis 1 minus sans-serif-italic p right-parenthesis% confidence interval for each contrast when the ESTIMATE option is specified. The value p must be between 0 and 1. By default, p is equal to the value of the ALPHA= option in the PROC PHREG statement, or 0.05 if that option is not specified.

E

requests that the bold upper L matrix be displayed.

ESTIMATE=keyword

requests that each individual contrast (that is, each row, l prime Subscript i Baseline bold-italic beta, of bold upper L bold-italic beta) or exponentiated contrast (normal e Superscript l prime Super Subscript i Superscript bold-italic beta) be estimated and tested. PROC PHREG displays the point estimate, its standard error, a Wald confidence interval, and a Wald chi-square test for each contrast. The significance level of the confidence interval is controlled by the ALPHA= option. You can estimate the contrast or the exponentiated contrast (normal e Superscript l prime Super Subscript i Superscript bold-italic beta), or both, by specifying one of the following keywords:

PARM

specifies that the contrast itself be estimated.

EXP

specifies that the exponentiated contrast be estimated.

BOTH

specifies that both the contrast and the exponentiated contrast be estimated.

SINGULAR=number

tunes the estimability check. This option is ignored when the full-rank parameterization is used. If bold v is a vector, define ABS(bold v) to be the largest absolute value of the elements of bold v. For a row vector bold-italic l prime of the contrast matrix bold upper L, define c to be equal to ABSleft-parenthesis bold-italic l right-parenthesis if ABSleft-parenthesis bold-italic l right-parenthesis is greater than 0; otherwise, c equals 1. If ABSleft-parenthesis bold-italic l prime minus bold-italic l prime bold upper T right-parenthesis is greater than c asterisk sans-serif-italic number, then bold-italic l is declared nonestimable. The bold upper T matrix is the Hermite form matrix bold upper I 0 Superscript minus Baseline bold upper I 0, where bold upper I 0 Superscript minus represents a generalized inverse of the information matrix bold upper I 0 of the null model. The value for number must be between 0 and 1; the default value is 1E–4.

TEST<(keywords)>

requests a Type 3 test for each contrast. The default is to use the Wald statistic, but you can requests other statistics by specifying one or more of the following keywords:

ALL

requests the likelihood ratio tests, the score tests, and the Wald tests. Specifying TEST(ALL) is equivalent to specifying TEST=(LR SCORE WALD).

NONE

suppresses the Type 3 analysis. Even if the TEST option is not specified, PROC PHREG displays the Wald test results for each model effect if a CLASS variable is involved in a MODEL effect. The NONE option can be used to suppress such display.

LR

requests the likelihood ratio tests. This request is not honored if the COVS option is also specified.

SCORE

requests the score tests. This request is not honored if the COVS option is also specified.

WALD

requests the Wald tests.

Last updated: December 09, 2022