BookmarkSubscribeRSS Feed
MoroccoMole
Calcite | Level 5

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 ;

3 REPLIES 3
PaigeMiller
Diamond | Level 26

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;

 

--
Paige Miller
MoroccoMole
Calcite | Level 5

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.

PaigeMiller
Diamond | Level 26

@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;

 

 

--
Paige Miller

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!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 3 replies
  • 2646 views
  • 0 likes
  • 2 in conversation