Hi all,
I am using PROC GLM Contrast statement to see if my data displays any trend like linear or quadratic. Somehow when I use two CONTRAST statements at the same time, the CONTRAST output does not come out.
Below is my code:
PROC GLM DATA=mydata;
CLASS RESP_TIME;
MODEL score= RESP_TIME ;
CONTRAST 'Linear' RESP_TIME -2 -1 0 1 2;
CONTRAST 'Quadratic' RESP_TIME 2 -1 -2 -1 2;
run;
Another question is: is it possible to do the trend plot along with CONTRAST statement?
Thanks a lot!
Lizi
Although it is possible to fit a quadratic model to only 3 time points, so few points provide very little support for the fit.
SAS Usage Note 22912 illustrates how to acquire coefficients for polynomial contrasts.
I hope this helps.
Thanks Reeza.
I added QUIT, and the log remains as below:
WARNING: More coefficients than levels specified for effect resp_time. Some coefficients will be ignored.
NOTE: CONTRAST Linear is not estimable.
WARNING: More coefficients than levels specified for effect resp_time. Some coefficients will be ignored.
NOTE: CONTRAST Quadratic is not estimable.
@lizzy28 wrote:
Thanks Reeza.
I added QUIT, and the log remains as below:
WARNING: More coefficients than levels specified for effect resp_time. Some coefficients will be ignored.
NOTE: CONTRAST Linear is not estimable.
How many levels of the variable RESP_TIME are there?
Are there levels of RESP_TIME that have no Y values (due to missing data)?
Thank you Reeza!
Paige, RESP_TIME has three levels with numeric values 1, 2 and 3, and it has not missing values. Thank you for looking into my question!
Then you can't specify a CONTRAST statement with 5 levels. You can only specify a CONTRAST statement with 3 levels.
My other question was about your Y variable, in this case SCORE, does it have a lot of missing values such that there is a level of RESP_TIME for which all the Y variables are missing?
I see that I should only set three levels. One further question is how I should decide the L matrix for linear vs quadratic.
Yes, there are about 8% missing values in SCORE.
Although it is possible to fit a quadratic model to only 3 time points, so few points provide very little support for the fit.
SAS Usage Note 22912 illustrates how to acquire coefficients for polynomial contrasts.
I hope this helps.
That makes sense. Thanks for the link. It provides me a quick understanding of polynomial coefficients.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.