Programming the statistical procedures from SAS

Predictive Model based on Logistic Regression Model

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Predictive Model based on Logistic Regression Model

Hello,

 

I am currently working with the Titanic_train dataset, which lists that survival of different passengers aboard the Titanic. I'm trying to take a logistic regression model I fit to that dataset and use it to predict the survial probabilities of a different dataset (Titanic_test). So far I have figured out the first part, the logistic regression model for the train dataset, with my code posted:

 


ods graphics on;
proc logistic data=TitanicTrain plots(only)=(roc(id=obs) effect);
model survived(event='1')=age male family passenger_class
/scale=none clparm=both clodds=both;
run;

 

However, I can't figure out how to take that model and and use it on the other dataset. For clarification, the second dataset doesn't tell me wether the passenger survived or not. I'm trying to predict that. I honestly don't know where to start on this problem and any help would be appreciated.


Accepted Solutions
Solution
‎06-29-2017 02:32 PM
Super User
Posts: 17,963

Re: Predictive Model based on Logistic Regression Model

http://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html

 

Please do not post the same question multiple times, I'll merge them into one here. 

 

What you're looking to do is called scoring a model and there are several ways to do so. The blog post in the link above shows the different methods with sample code. 

 

View solution in original post


All Replies
New Contributor
Posts: 3

How do I predict values for one dataset based on a logistic regression model of another?

Hello,

 

I am currently working with the Titanic_train dataset, which lists that survival of different passengers aboard the Titanic. I'm trying to take a logistic regression model I fit to that dataset and use it to predict the survial probabilities of a different dataset (Titanic_test). So far I have figured out the first part, the logistic regression model for the train dataset, with my code posted:

 


ods graphics on;
proc logistic data=TitanicTrain plots(only)=(roc(id=obs) effect);
model survived(event='1')=age male family passenger_class
/scale=none clparm=both clodds=both;
run;

 

However, I can't figure out how to take that model and and use it on the other dataset. For clarification, the second dataset doesn't tell me wether the passenger survived or not. I'm trying to predict that. I honestly don't know where to start on this problem and any help would be appreciated.

Valued Guide
Valued Guide
Posts: 684

Re: How do I predict values for one dataset based on a logistic regression model of another?

Scoring, which is what you want, is especially easy with PROC LOGISTIC. Just use the SCORE statement. Details in example:

http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_logistic_exa...

 

Solution
‎06-29-2017 02:32 PM
Super User
Posts: 17,963

Re: Predictive Model based on Logistic Regression Model

http://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html

 

Please do not post the same question multiple times, I'll merge them into one here. 

 

What you're looking to do is called scoring a model and there are several ways to do so. The blog post in the link above shows the different methods with sample code. 

 

New Contributor
Posts: 3

Re: Predictive Model based on Logistic Regression Model

Thank you for your help and I'm sorry about posting it multiple times. 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 153 views
  • 1 like
  • 3 in conversation