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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 819 views
  • 1 like
  • 2 in conversation