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 2025: Call for Content

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!

Submit your idea!

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