The PHREG Procedure

TEST Statement

  • <label:> TEST equation <,, equation> </ options>;

The TEST statement tests linear hypotheses about the regression coefficients. PROC PHREG performs a Wald test for the joint hypothesis specified in a single TEST statement. Each equation specifies a linear hypothesis; multiple equations (rows of the joint hypothesis) are separated by commas. The label, which must be a valid SAS name, is used to identify the resulting output and should always be included. You can submit multiple TEST statements.

The form of an equation is as follows:

term < plus-or-minus term …> <= < plus-or-minus term <plus-or-minus term …>>>

where term is a variable or a constant or a constant times a variable. The variable is any explanatory variable in the MODEL statement. When no equal sign appears, the expression is set to 0. The following program illustrates possible uses of the TEST statement:

proc phreg;
   model time= A1 A2 A3 A4;
   Test1: test A1, A2;
   Test2: test A1=0,A2=0;
   Test3: test A1=A2=A3;
   Test4: test A1=A2,A2=A3;
run;

Note that the first and second TEST statements are equivalent, as are the third and fourth TEST statements.

The following options can be specified in the TEST statement after a slash (/):

AVERAGE

enables you to assess the average effect of the variables in the given TEST statement. An overall estimate of the treatment effect is computed as a weighted average of the treatment coefficients as illustrated in the following statement:

TREATMENT: test trt1, trt2, trt3, trt4 / average;

Let beta 1, beta 2, beta 3, and beta 4 be corresponding parameters for trt1, trt2, trt3, and trt4, respectively. Let ModifyingAbove bold-italic beta With caret equals left-parenthesis ModifyingAbove beta With caret Subscript 1 Baseline comma ModifyingAbove beta With caret Subscript 2 Baseline comma ModifyingAbove beta With caret Subscript 3 Baseline comma ModifyingAbove beta With caret Subscript 4 Baseline right-parenthesis prime be the estimated coefficient vector and let ModifyingAbove bold upper V With caret left-parenthesis ModifyingAbove bold-italic beta With caret right-parenthesis be the corresponding variance estimate. Assuming beta 1 equals beta 2 equals beta 3 equals beta 4, let beta overbar be the average treatment effect. The effect is estimated by bold c prime ModifyingAbove bold-italic beta With caret, where bold c equals left-bracket bold 1 prime Subscript 4 Baseline ModifyingAbove bold upper V With caret Superscript negative 1 Baseline left-parenthesis ModifyingAbove bold-italic beta With caret right-parenthesis bold 1 Subscript 4 Baseline right-bracket Superscript negative 1 Baseline ModifyingAbove bold upper V With caret Superscript negative 1 Baseline left-parenthesis ModifyingAbove bold-italic beta With caret right-parenthesis bold 1 Subscript 4 and bold 1 Subscript 4 Baseline equals left-parenthesis 1 comma 1 comma 1 comma 1 right-parenthesis prime. A test of the null hypothesis upper H 0 colon beta overbar equals 0 is also included, which is more sensitive than the multivariate test for testing the null hypothesis upper H 0 colon beta Baseline 1 equals beta Baseline 2 equals beta Baseline 3 equals beta Baseline 4 equals 0.

E

specifies that the linear coefficients and constants be printed. When the AVERAGE option is specified along with the E option, the optimal weights of the average effect are also printed in the same tables as the coefficients.

PRINT

displays intermediate calculations. This includes bold upper L ModifyingAbove bold upper V With caret left-parenthesis ModifyingAbove bold-italic beta With caret right-parenthesis bold upper L prime bordered by left-parenthesis bold upper L ModifyingAbove bold-italic beta With caret minus bold c right-parenthesis, and left-bracket bold upper L ModifyingAbove bold upper V With caret left-parenthesis ModifyingAbove bold-italic beta With caret right-parenthesis bold upper L prime right-bracket Superscript negative 1 bordered by left-bracket bold upper L ModifyingAbove bold upper V With caret left-parenthesis ModifyingAbove bold-italic beta With caret right-parenthesis bold upper L prime right-bracket Superscript negative 1 Baseline left-parenthesis bold upper L ModifyingAbove bold-italic beta With caret minus bold c right-parenthesis, where bold upper L is a matrix of linear coefficients and bold c is a vector of constants.

For more information, see the section Using the TEST Statement to Test Linear Hypotheses.

Last updated: December 09, 2022