BookmarkSubscribeRSS Feed
NaNaN
Calcite | Level 5

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 

 

3 REPLIES 3
Rick_SAS
SAS Super FREQ

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.

 

NaNaN
Calcite | Level 5
Thanks for your suggestion! I’m not sure how this missing value trick can be applied if I want to implement this model in a system that can score in live.
Rick_SAS
SAS Super FREQ

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.

sas-innovate-2024.png

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.

 

Register now!

Multiple Linear Regression in SAS

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.

Discussion stats
  • 3 replies
  • 616 views
  • 1 like
  • 2 in conversation