The SURVEYREG Procedure

CONTRAST Statement

  • CONTRAST ’label’ effect values </ options>;

  • CONTRAST ’label’ effect values <…effect values> </ options>;

The CONTRAST statement provides custom hypothesis tests for linear combinations of the regression parameters upper H 0 colon bold upper L bold-italic beta equals bold 0, where bold upper L is the vector or matrix you specify and bold-italic beta is the vector of regression parameters. Thus, to use this feature, you must be familiar with the details of the model parameterization used by PROC SURVEYREG. For information about the parameterization, see the section GLM Parameterization of Classification Variables and Effects in Chapter 20, Shared Concepts and Topics.

Each term in the MODEL statement, called an effect, is a variable or a combination of variables. You can specify an effect with a variable name or a special notation by using variable names and operators. For more details about how to specify an effect, see the section Specification of Effects in Chapter 53, The GLM Procedure.

For each CONTRAST statement, PROC SURVEYREG computes Wald’s F test. The procedure displays this value with the degrees of freedom, and identifies it with the contrast label. The numerator degrees of freedom for Wald’s F test equal rank(bold upper L). The denominator degrees of freedom equal the number of clusters (or the number of observations if there is no CLUSTER statement) minus the number of strata. Alternatively, you can use the DF= option in the MODEL statement to specify the denominator degrees of freedom.

You can specify any number of CONTRAST statements, but they must appear after the MODEL statement.

In the CONTRAST statement,

label

identifies the contrast in the output. A label is required for every contrast specified. Labels must be enclosed in single quotes.

effect

identifies an effect that appears in the MODEL statement. You can use the INTERCEPT keyword as an effect when an intercept is fitted in the model. You do not need to include all effects that are in the MODEL statement.

values

are constants that are elements of bold upper L associated with the effect.

You can specify the following options in the CONTRAST statement after a slash (/):

E

displays the entire coefficient bold upper L vector or matrix.

NOFILL

requests no filling in higher-order effects. When you specify only certain portions of bold upper L, by default PROC SURVEYREG constructs the remaining elements from the context. (For more information, see the section Specification of ESTIMATE Expressions in Chapter 53, The GLM Procedure.)

When you specify the NOFILL option, PROC SURVEYREG does not construct the remaining portions and treats the vector or matrix bold upper L as it is defined in the CONTRAST statement.

SINGULAR=value

tunes the estimability checking. 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 l of the matrix bold upper L , define

c equals StartLayout Enlarged left-brace 1st Row 1st Column ABS left-parenthesis bold l right-parenthesis 2nd Column if ABS left-parenthesis bold l right-parenthesis greater-than 0 2nd Row 1st Column 1 2nd Column otherwise EndLayout

If ABS(bold l minus bold l bold upper H) is greater than c*value, then bold l bold-italic beta is declared nonestimable. Here, bold upper H is the matrix left-parenthesis bold upper X prime bold upper X right-parenthesis Superscript minus Baseline bold upper X prime bold upper X. The value must be between 0 and 1; the default is 10 Superscript negative 7.

As stated previously, the CONTRAST statement enables you to perform hypothesis tests upper H 0 colon bold upper L bold-italic beta equals 0.

If the bold upper L matrix contains more than one contrast, then you can separate the rows of the bold upper L matrix with commas.

For example, for the model

proc surveyreg;
   class A B;
   model Y=A B;
run;

with A at 5 levels and B at 2 levels, the parameter vector is

left-parenthesis mu alpha 1 alpha 2 alpha 3 alpha 4 alpha 5 beta 1 beta 2 right-parenthesis

To test the hypothesis that the pooled A linear and A quadratic effect is zero, you can use the following bold upper L matrix:

bold upper L equals Start 2 By 8 Matrix 1st Row 1st Column 0 2nd Column negative 2 3rd Column negative 1 4th Column 0 5th Column 1 6th Column 2 7th Column 0 8th Column 0 2nd Row 1st Column 0 2nd Column 2 3rd Column negative 1 4th Column negative 2 5th Column negative 1 6th Column 2 7th Column 0 8th Column 0 EndMatrix

The corresponding CONTRAST statement is

contrast 'A Linear & Quadratic'
         a -2 -1  0  1  2,
         a  2 -1 -2 -1  2;
Last updated: December 09, 2022