Hi there,
I read a paper about applying mixed effect model to predict a fractional response attribution with the range of [0,1]. Please see the code in below:
%let level=obligor_id; proc sort data=MyData; by &level; run; proc nlmixed data=MyData noad qpoints=80 tech=quanew maxiter=3000 maxfunc=3000 qtol=0.0001; parms b0-b14=0.0001 gamma1-gamma2=0.4; cov_mu=b0+b1*Var1+b2*Var2+…+b14*Var14; con_mu=cov_mu+gamma1*z; con_sigma=gamma2**2; model RR~normal(con_mu,con_sigma); random z~normal(0,1) subject=&level; predict con_mu out= mix_output_&level (keep=instrument_id RR pred); run;
For my problem, I replaced the obligor_id with account_num, which is unique in my dataset. The result returned from this model was really good. The problem now is how to apply this model to score a out-of-time data set with the random effect?
Looking forward to any suggestions.
Thanks!
-Shelly
You can use the "missing value trick" to score additional data in conjunction with the PREDICT statement that you are already using. Some caveats and examples are discussed in another thread and on the excellent UCLA statistics site.
I don't think that trick works for new data. You'll have to write the DATA step code to score the model from the parameter estimates.
Now that I look at your model, isn't it linear? If so, you can switch to PROC MIXED and use the STORE statement to save the model and PROC PLM to evaluate the model on new data.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.