turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Test for trend using median values

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-24-2016 08:51 AM

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.

Accepted Solutions

Solution

11-04-2016
06:19 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-02-2016 01:57 PM - edited 11-07-2016 09:18 AM

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

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-25-2016 05:59 AM

Check PROC CATMOD which can perform ANOVA or REG analysis.

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-26-2016 08:57 AM

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!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-25-2016 10:39 PM

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

Solution

11-04-2016
06:19 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-02-2016 01:57 PM - edited 11-07-2016 09:18 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-04-2016 06:19 AM

Thanks! It worked