proc logistic data= train descending;
   class Emp_status Gender Marital_status;
   model Default = Checking_amount  Term  Credit_score  Gender  Marital_status  
   Car_loan  Personal_loan  Home_loan  Education_loan  Emp_status  
   Amount  Saving_amount  Emp_duration  Age  No_of_credit_acc;

As you can see, I already made a logistic regression on train dataset. However, how can I make the prediction on the test dataset? I checked online, but there are not many sources to implement this.


1 Answer 1

proc surveyselect data=work.data method=srs seed=2 outall
samprate=0.7 out=work.data_subset;

data training;
set work.data_subset; *dataset in your work directory;
if selected = 1;

data testing;
set work.data_subset; *dataset in your working directory;
if selected = 0;

ods graphics on;
proc logistic data=work.training descending plots=roc;
class Gender /param = effect ref = first; *categorical variable;
model default = x1 x2 x3 x4 x5
/ link=logit;
score data=work.testing out=work.logisticOoutput;
ods graphics off;

Using proc surveyselect to split the dataset 70% 30%, we can split our dataset into train and test. Then, we can run logistic regression on train data. see the performance on the test dataset.

score data=work.testing 

This command is running the regression on the test set. see the result in the output.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.