BookmarkSubscribeRSS Feed
Obsidian | Level 7

Hi everyone,

I am hoping to get your expertise on showing whether the change in median age over time is statistically different.

For example, here is what my data looks like:

Median Age20221926232429

I would appreciate any help!  What statistical test should I use and please advise on the corresponding SAS code.

Many thanks!

Jade | Level 19

With only this data, I think the first statistical test you might look at is whether there is a significant trend in the data, using linear regression.  Without the raw data or error estimates at each time point, I don't see any other way to attack this.  Any of the modeling procedures (REG, GLM, MIXED, GENMOD, GLIMMIX, HPMIXED, CALIS) could do this.

data have;

input year med_age;


2000 20

2001 22

2002 19

2003 26

2004 23

2005 24

2006 29


proc reg data=have;

model med_age=year;


This should get you started.

Steve Denham

Calcite | Level 5

Hi Steve,


I have a question that is similar to the one asked in this thread, but in my data, I have the raw data (and can therefore compute the error estimates) for each time point. In this case, what is the best way to analyze the median change over time?


For some context (and to help you better understand my question), I have a dataset with participants with seizures and want to see if their weekly seizure count (which is actually often a decimal, so not pure "count" data) decreases over the course of therapy. Because average weekly seizures is not normal, I would like to use medians to see if there is a decrease over time. I have the data for each individual without any missing data. My sample size is fairly small. What do you suggest?




Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.


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
  • 2 replies
  • 3 in conversation