BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sasbee
Fluorite | Level 6

I am trying to get an estimated from the model I ran using Proc Mix for a continuous variables (ie. year). Is there a easy way to output Y for year=x fixing the other covariates at certain level? such as the lincom command in Stata? 

 

I.e. 

y=intercept+b1(year)+b2(sex)+b3(race)+b4(exposure)+b5(year^2)+b6(exposure*year)+b7(exposure*year^2)

 

Thanks. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

This is called a "slice" through the response surface. There are two approaches:

1. If you want a graph of the predicted response versus the Year, holding other variables fixed, you can use the EFFECTPLOT statement in several SAS regression procedures. However, mixed modeling procedures do not support the EFFECTPLOT statement directly, you have to STORE the model and then use PROC PLM to create the sliced fit plot.

 

2. If you want a table that shows the predicted responses at particular values of Year (holding other variables constant), you can STORE the model and then use PROC PLM and the SCORE statement to score the model on whatever values you want.

 

The nice thing about the graphical method is there is built-in support for fixing the covariates at the mean or median. For the scoring method, you would have to precompute those values yourself if you want to use them as the covariate values.

View solution in original post

1 REPLY 1
Rick_SAS
SAS Super FREQ

This is called a "slice" through the response surface. There are two approaches:

1. If you want a graph of the predicted response versus the Year, holding other variables fixed, you can use the EFFECTPLOT statement in several SAS regression procedures. However, mixed modeling procedures do not support the EFFECTPLOT statement directly, you have to STORE the model and then use PROC PLM to create the sliced fit plot.

 

2. If you want a table that shows the predicted responses at particular values of Year (holding other variables constant), you can STORE the model and then use PROC PLM and the SCORE statement to score the model on whatever values you want.

 

The nice thing about the graphical method is there is built-in support for fixing the covariates at the mean or median. For the scoring method, you would have to precompute those values yourself if you want to use them as the covariate values.

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
  • 1 reply
  • 2330 views
  • 1 like
  • 2 in conversation