BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
stew90210
Obsidian | Level 7

Hi All,

 

I was hoping you could help me out, we are currently looking at SAS VIYA and considering how we can make best use of it. One of the key features we want to use is model manager, I have watched hours of training and spent more searching for what I would have thought would have been a very simple procedure but it almost seems like it is either impossible or just "not done".

 

I have several super simple models that are imbedded in larger pieces of code and used to give a probability percentage using a straightforward formula with imbedded correlation and slope numbers i.e. WantVar  = -1.49746+(HaveVar1*(-0.021799)+(HaveVar2*(0.7232))

 

my question is this: how on earth do i take that simple formula and get it into SAS model manager so we can start tracking it

1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

Hello @stew90210 ,

 

First make data step score code like this :

 

data work.train;
   input HaveVar1 HaveVar2 @@;
   WantVar  = -1.49746+( HaveVar1*(-0.021799)+( HaveVar2*(0.7232) ) );
   datalines;
143 56.3 155 62.3 153 63.3 161 59.0 
191 62.5 171 62.5 185 59.0 142 56.5 
160 62.0 140 53.8 139 61.5 178 61.5 
157 64.5 149 58.3 143 51.3 145 58.8 
191 65.3 150 59.5 147 61.3 180 63.3 
164 66.5 189 65.0 164 61.5 167 62.0 
151 59.3 
;
run;

filename modelref filesrvc folderpath='/Users/myUserID/My Folder' name='score.sas';

proc reg outest=est1 outsscp=sscp1 rsquare;
   eq1: model WantVar=HaveVar1 HaveVar2;
   code file=modelref;
run;
QUIT;
/* end of program */

 

 

Then:
Import that Model Using a DATA Step Score Code File
See here on how to do that :

SAS® Model Manager | 2021.2.4
Macro Reference
Model Management Macros
%MM_IMPORT_MODEL Macro
Example 5: Import a Model Using a DATA Step Score Code File
https://go.documentation.sas.com/doc/en/mdlmgrcdc/v_017/mdlmgrmacro/n0gcmowinwrpnyn1obg3o8vtmu79.htm

 

BR,
Koen

View solution in original post

1 REPLY 1
sbxkoenk
SAS Super FREQ

Hello @stew90210 ,

 

First make data step score code like this :

 

data work.train;
   input HaveVar1 HaveVar2 @@;
   WantVar  = -1.49746+( HaveVar1*(-0.021799)+( HaveVar2*(0.7232) ) );
   datalines;
143 56.3 155 62.3 153 63.3 161 59.0 
191 62.5 171 62.5 185 59.0 142 56.5 
160 62.0 140 53.8 139 61.5 178 61.5 
157 64.5 149 58.3 143 51.3 145 58.8 
191 65.3 150 59.5 147 61.3 180 63.3 
164 66.5 189 65.0 164 61.5 167 62.0 
151 59.3 
;
run;

filename modelref filesrvc folderpath='/Users/myUserID/My Folder' name='score.sas';

proc reg outest=est1 outsscp=sscp1 rsquare;
   eq1: model WantVar=HaveVar1 HaveVar2;
   code file=modelref;
run;
QUIT;
/* end of program */

 

 

Then:
Import that Model Using a DATA Step Score Code File
See here on how to do that :

SAS® Model Manager | 2021.2.4
Macro Reference
Model Management Macros
%MM_IMPORT_MODEL Macro
Example 5: Import a Model Using a DATA Step Score Code File
https://go.documentation.sas.com/doc/en/mdlmgrcdc/v_017/mdlmgrmacro/n0gcmowinwrpnyn1obg3o8vtmu79.htm

 

BR,
Koen

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Discussion stats
  • 1 reply
  • 526 views
  • 1 like
  • 2 in conversation