I want to compare slope of change for a couple variables and thus am looking to output individuals slopes for a few variables and merge the data sets. However I have had no luck finding how to output individual persons slopes from a proc mixed model.
I am using a tall data set with about 10 observations for each person. The code I am using is like so, and to this I am hoping to add an "output out = slope" type statement.
proc mixed data = ExampleData method=ml;
class Person;
model DV = IV ;
random intercept week /type=un subject=Person;
run ;
You need to use ODS OUTPUT and the SOLUTION option of the MODEL statement.
Example
ods output solutionf=slopes;
proc mixed data=sashelp.class;
class sex;
model weight=height sex/solution;
run;
Thank you for the reply.
That seems to be producing a data set with a single estimate for intercept and slope. What I am aiming to do is get those estimates for each person in the data set. I am trying to produce a data set that has one row for each ID number and an estimate for slope for each ID number.
@MoroccoMole wrote:
Thank you for the reply.
That seems to be producing a data set with a single estimate for intercept and slope. What I am aiming to do is get those estimates for each person in the data set. I am trying to produce a data set that has one row for each ID number and an estimate for slope for each ID number.
It's not clear to me that you can get individual slopes for each person. Are they output from PROC MIXED when you run your code? If it is possible (you can do the testing) then you would need
ODS OUTPUT SOLUTIONR=slopes;
hello, were you able to solve this query?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.