BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Marjolein
Obsidian | Level 7

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.

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

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

View solution in original post

5 REPLIES 5
Ksharp
Super User

Check PROC CATMOD which can perform ANOVA or REG analysis.

And there is already an example like yours about social ability in documentation.

Marjolein
Obsidian | Level 7
I indeed did an ANOVA and I imputated the median values as new variable, and put this in the class statement! So it's solved! Thanks for the input!
Ksharp
Super User

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 .........

SteveDenham
Jade | Level 19

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

Marjolein
Obsidian | Level 7

Thanks! It worked 😄

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 5 replies
  • 3892 views
  • 0 likes
  • 3 in conversation