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
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
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
Thanks Steve!
How simple... Sometimes I tend to complicate things... ;o)
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.
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.