Hi all,
I'm trying to perform a test for trend in an ANOVA procedure. For example: I have 4 categories of a blood parameter (from which I obtained the median values), and I want to see whether some kind of baseline characteristic (e.g. age) increases linearly with this blood parameter.
This is what I've tried:
PROC GLM DATA=my.data;
CLASS bloodparameter;
MODEL age = bloodparameter;
CONTRAST "linear trend" bloodparameter 1.71 2.14 2.63 3.62 ;
MEANS bloodparameter;
RUN;
I searched on the internet and I saw the following code for the linear trend test: x -3 -1 1 3.
Therefore I replaced it with the median values, since they are not equally spaced.
However, SAS says the trend is not estimatable. What am I doing wrong?
Thanks a lot in advance.
Kind regards, M.
There are several on-line calculators that can give the coefficients for a linear trend with unequal spacing. The key is that the coefficients in a CONTRAST statement must sum to zero. You can do this by subtracting the mean of the values you have from each individual value. In this case, I got -0.815 -0.385 0.105 1.095. Try plugging in those values where you currently have 1.71 2.14 2.63 3.62,
Steve Denham
Check PROC CATMOD which can perform ANOVA or REG analysis.
And there is already an example like yours about social ability in documentation.
Or you can just check the correlation coefficient of row and column variable by PROC FREQ.
Check statistical GAMMA,Kendall's Tau,Somer's D .........
There are several on-line calculators that can give the coefficients for a linear trend with unequal spacing. The key is that the coefficients in a CONTRAST statement must sum to zero. You can do this by subtracting the mean of the values you have from each individual value. In this case, I got -0.815 -0.385 0.105 1.095. Try plugging in those values where you currently have 1.71 2.14 2.63 3.62,
Steve Denham
Thanks! It worked 😄
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.