Date: Tue, 14 Dec 2010 09:49:04 -0800
Reply-To: "Jordan, Lewis" <Lewis.Jordan@WEYERHAEUSER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Jordan, Lewis" <Lewis.Jordan@WEYERHAEUSER.COM>
Subject: PROC NLMIXED - Capture Minimum Value of random effects...
Content-Type: text/plain; charset="us-ascii"
I'm wanting to "capture" the minimum value of the random effects in a PROC NLMIXED call. I'm then going to use this minimum value to modify a likelihood function I'm working with.
However, I can not seem to "capture" the minimum random effect. Unfortunately, there is no listing in the PROC NLMIXED help referencing keywords. This is what I've come up with so far, but the values are not equivalent. I've attached a simple example with my attempts to find the minimum value of the random effect: min(bi).
Any help would be appreciated.
*Simulate some data;
do subject=1 to 50;
do i=1 to 5;
y= 5 + ai + rand('NORMAL',0,4);
*Put NLMIXED call in a macro to see "keywords"/"code listing";
options mprint symbolgen mlogic;
proc nlmixed data=sim lognote;
parms mu = 5 s2e = 16 s2b = 4;
*Set min_bi to some large #;
mean = Mu + bi;
retain min_bi 1.0E10;
*Capture minimum value of the random effects;
if bi<min_bi then min_bi=bi;
random bi~normal(0,s2b) subject=subject out=randoms;
predict mean out=preds;
id bi min_bi;
*Proc means to see what the "minimum" value of bi really was,
and what the value of "min_bi" was captured as...;
proc means data=preds min;
var bi min_bi;