BookmarkSubscribeRSS Feed
Therain
Calcite | Level 5

Hello,

 

I use SAS 9.4 and I have a data set like this:

ID     pcs        year        disease

1       45          1            1

1       47          2            1

1       50          3            1

2       42          1            0

2       43          2            0

2       46          3            0

3       40          1            0

3       40          2            0

3       49          3            0

...

 

I want to see how the presence or absence of disease affect the PCS scores rate of change from year 1 to year 3 for each subject. I run the following codes:

 

proc glimmix data=have;
class disease (ref='0');
model pcs = disease year disease*year / cl;
run;

 

Then I got the results but I do not think it is correct, since the estimate for intercept is around 12, but the average pcs at year 1 is over 40 instead of 12. Does anyone can help me figure out the problem?

 

Thank you!

2 REPLIES 2
Ksharp
Super User
In GLIMMIX , use RANDOM to get repeated measures ( R- side random effect).

proc glimmix data=have;
class disease (ref='0')  id year ;
model pcs = disease year disease*year / cl;
random year/subject=id type=ar(1) residual;
run;



Therain
Calcite | Level 5

Thank you for the reply! When I run your codes I met another problem. 

 

I can get parameter estimates for intercept, disease, year, and disease*year. But when I add some other covariates into the model, i found that the estimates for intercept and disease changed but the estimate for disease*year remained the same. I am not quite sure if this is correct? (I think the estimate for disease*year should change and the estimates for intercept and disease should remain the same).

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
  • 2 replies
  • 1342 views
  • 0 likes
  • 2 in conversation