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 < $\pm $ term …> <= < $\pm $ term < $\pm $ 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;

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 (/):


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 $\hat{\bbeta }=(\hat{\beta }_1,\hat{\beta }_2,\hat{\beta }_3,\hat{\beta }_4)’$ be the estimated coefficient vector and let $\hat{\bV }(\hat{\bbeta })$ be the corresponding variance estimate. Assuming $\beta _1=\beta _2=\beta _3=\beta _4$, let $\bar{\beta }$ be the average treatment effect. The effect is estimated by $\mb {c}’\hat{\bbeta }$, where $ \mb {c} = [\mb {1}’_4 \hat{\bV }^{-1}(\hat{\bbeta }) \mb {1}_4]^{-1}\hat{\bV }^{-1}(\hat{\bbeta }) \mb {1}_4 $ and $\mb {1}_4=(1,1,1,1)’$. A test of the null hypothesis $H_0: \bar{\beta }=0$ is also included, which is more sensitive than the multivariate test for testing the null hypothesis $H_0: \beta 1=\beta 2=\beta 3=\beta 4=0$.


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.


displays intermediate calculations. This includes $\bL \hat{\mb {V}} ( \hat{\bbeta } ) \bL ’$ bordered by $(\bL \hat{\bbeta }-\mb {c})$, and $[\bL \hat{\bV }(\hat{\bbeta })\bL ’]^{-1}$ bordered by $[\bL \hat{\bV }(\hat{\bbeta }) \bL ’]^{-1}(\bL \hat{\bbeta }-\mb {c})$, where $\bL $ is a matrix of linear coefficients and $\mb {c}$ is a vector of constants.

See the section Using the TEST Statement to Test Linear Hypotheses for details.