//
//Score command
//
//this command is used test phase after making regression or logit model.

//syntax is same as model making.
score [target] by [variables]/
(option)
;
//option 
//This option is useful for logistic regression.
target=1 or 0 //target is direction of probability.

//Examble Regression
//read weekly time series.
get salesWk_Fuel.csv@/
titleline=1
;

put salesWk@;

//show inputed time series.
get salesWk@;
plot line Weekly_Sales by Date/
xpitch=8
xrotate=90
;

//conver month number to dummy 11 variables. get salesWk@; attr name type/ month code ; onehot month; //Divide data train and test if(# <= 100) outrec train@; else outrec test@; //Regression with dummy variables. get train@; reg Weekly_Sales by Holiday_Flag Temperature Fuel_Price month_dmy1-11; //AdjSqure 0.588 get freq@ana; select Weekly_Sales reg; put trainout; //Sumirate regression with same arguments. get test@; score Weekly_Sales by Holiday_Flag Temperature Fuel_Price month_dmy1-11; get freq@ana; select Weekly_Sales reg; //rename reg valuables for merging trained data. attr name rename/ reg test ; put testout; //concatiname result of train and test data. get trainout; concat testout; //comparison with actual data and result output. plot line test Weekly_Sales reg/ color=red width=2 ;