Hello, Currently, I encountered one problem from Proc NLMIXED procedure. Any advice will be appreciated. After I build random effect model by Proc NLMIXED, the event% from prediction is always lower than actual value. Here, I will use the example from "Fixed effects regression methods fro longitudinal data" (by Paul D. Allison) to describe my problem. After run the code below, I got predicted Phat for both fixed and random effects and saved in data P2 and P respectively. Then I calculated the yearly event rate and compare them with actual value. PROC NLMIXED DATA=teenyrs5; eta=b0 + byr1*(year=1)+ byr2*(year=2) + byr3*(year=3) +byr4*(year=4) + bmother*mother +bspouse*spouse +bschool*inschool + bhours*hours + alpha; p=1/(1+ EXP(-eta)); MODEL pov~BINARY(p); RANDOM alpha ~ NORMAL(0,s2) SUBJECT=id out=abc; PARMS b0=-.29 byr1=-.06 byr2=.16 byr3=.09 byr4=.09 bmother=.99 bspouse=-1.26 bschool=.24 bhours=-.03 s2=1 ; predict P out=p; predict 1/(1+ EXP(-(b0 + byr1*(year=1)+ byr2*(year=2) + byr3*(year=3) + byr4*(year= 4) + bmother*mother + bspouse*spouse + bschool*inschool + bhours*hours))) out=p2; RUN; From both data and charts(attached picture), the predicted rates were lower than actual value with parallel shift. year actual_rt RT_random RT_Fixed 1 34.84% 33.97% 31.21% 2 39.88% 39.49% 37.45% 3 37.97% 37.43% 35.34% 4 38.92% 38.51% 36.54% 5 36.84% 36.27% 34.25% Since this is the first time I use Proc NLMIXED, I wonder if there is anything wrong in my process to predict yhat.Meanwhile, could I also setup the mean of alpha as random term instead of constant of 0. Thanks a lot in advance.
... View more