BookmarkSubscribeRSS Feed
Ruan1
Calcite | Level 5

I am using the GLIMMIX model to do an age-period-cohort analysis.  I need a graph shows how the predicted probability of Y_var for each education level changes by COHORT. Just as the picture attached. I am new at SAS. So how can I get the graph? or how can i get the predicted numbers by education by cohort?

 

1.png

 

********* HERE IS THE CODE---------------------------;
proc glimmix data=NHIS_2 maxopt=250000;
      class PERIOD COHORT EDUCATION RACE SEX;
      model Y_var (event='1') = AGE AGE_2 SEX RACE EDUCATION EDUCATION*AGE  /solution CL
      dist=binary;
      random intercept SEX RACE /sub=PERIOD solution;
      random intercept /sub=COHORT solution;
     covtest GLM / WALD;
     NLOPTIONS TECHNIQUE=NRRIDG;

RUN;

1 REPLY 1
Ruan1
Calcite | Level 5

I try the effectplot, but it seems the "x=var" only permits the variable included in the model. But the "COHORT" var is in the RANDOM part. SO):

 

proc plm restore=model2;
effectplot slicefit(x=age sliceby=education) / clm;
run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 677 views
  • 0 likes
  • 1 in conversation