CONTRAST Statement
CONTRAST Statement
CONTRAST 'label' effect values < ... effect values > < / options > ;
The CONTRAST statement enables you to perform custom hypothesis tests by specifying an L vector or matrix for testing the univariate hypothesis
In the CONTRAST statement,
label
identifies the contrast on the output. A label is required for every contrast specified. Labels must be enclosed in quotes.
effect
identifies an effect that appears in the MODEL statement, or the INTERCEPT effect. The INTERCEPT effect can be used 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 the L vector associated with the effect.
You can specify the following options in the CONTRAST statement after a slash(/):
E
displays the entire L vector. This option is useful in confirming the ordering of parameters for specifying L.
E=effect
specifies an error term, which must be one of the effects in the model. The procedure uses this effect as the denominator in F tests in univariate analysis. In addition, if you use a MANOVA or REPEATED statement, the procedure uses the effect specified by the E= option as the basis of the E matrix. By default, the procedure uses the overall residual or error mean square (MSE) as an error term.
ETYPE=n
specifies the type (1, 2, 3, or 4, corresponding to Type I, II, III, and IV tests, respectively) of the E= effect. If the E= option is specified and the ETYPE= option is not, the procedure uses the highest type computed in the analysis.
SINGULAR=number
checking (GLM) tunes the estimability checking. If ABS(L-LH) > C×number for any row in the contrast, then L is declared nonestimable. H is the (X'X)-X'X matrix, and C is ABS(L) except for rows where L is zero, and then it is 1. The default value for the SINGULAR= option is 10-4. Values for the SINGULAR= option must be between 0 and 1.
As stated previously, the CONTRAST statement enables you to perform custom hypothesis tests. If the hypothesis is testable in the univariate case, SS(
(Lb)'(L(X'X)- L')-1(Lb)
where b = (X'X)-X'y. This is the sum of squares displayed on the analysis-of-variance table.
For multivariate testable hypotheses, the usual multivariate tests are performed using
H = M'(LB)' (L(X'X)- L')-1 (LB)M
where B = (X'X)-X'Y and Y is the matrix of multivariate responses or dependent variables. The degrees of freedom associated with the hypothesis is equal to the row rank of L. The sum of squares computed in this situation are equivalent to the sum of squares computed using an L matrix with any row deleted that is a linear combination of previous rows.
Multiple-degree-of-freedom hypotheses can be specified by separating the rows of the L matrix with commas.
For example, for the model
proc glm;
class A B;
model Y=A B;
run;
with A at 5 levels and B at 2 levels, the parameter vector is
To test the hypothesis that the pooled A linear and A quadratic effect is zero, you can use the following L matrix:
The corresponding CONTRAST statement is
contrast 'A LINEAR & QUADRATIC'
a -2 -1 0 1 2,
a 2 -1 -2 -1 2;
If the first level of A is a control level and you want a test of control versus others, you can use this statement:
contrast 'CONTROL VS OTHERS' a -1 0.25 0.25 0.25 0.25;
با تشکر از کسانی که با نظرات و انتقادهای خود باعث بالا رفتن کیفیت وبلاگ می شوند.