SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Boni
Calcite | Level 5

Hi,

I wonder if it is possible to retain the original identification (Here: unikdyr) from the dataset in the solution output from the random statement in PROC MIXED.

SAS code:

ods output solutionR=sol;

ods trace on;

PROC MIXED data=b covtest ratio;

     id unikdyr;

     model ekm = dimund60 dimov60 / s ddfm=bw outp=predicted;

     random dimund60 dimov60 int / type=un subject=unikdyr solution;

run;

odc trace off;

In the Solution output (sol) each individual now got a subject number, but I would like to be able to link that subjectnumber to an animalnumber (=unikdyr) because I want to use the random estimates in another model.

Any good ideas??

Thanks - Bodil

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

Add a CLASS statement (I changed the ID statement to a CLASS statement, but you may need both for your outp= option statement):

PROC MIXED data=b covtest ratio;

     class unikdyr;

     model ekm = dimund60 dimov60 / s ddfm=bw outp=predicted;

     random dimund60 dimov60 int / type=un subject=unikdyr solution;

run;

The dataset sol should have what you are looking for.

Steve Denham

View solution in original post

2 REPLIES 2
SteveDenham
Jade | Level 19

Add a CLASS statement (I changed the ID statement to a CLASS statement, but you may need both for your outp= option statement):

PROC MIXED data=b covtest ratio;

     class unikdyr;

     model ekm = dimund60 dimov60 / s ddfm=bw outp=predicted;

     random dimund60 dimov60 int / type=un subject=unikdyr solution;

run;

The dataset sol should have what you are looking for.

Steve Denham

Boni
Calcite | Level 5

Thanks Steve!

How simple... Sometimes I tend to complicate things... ;o)

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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