BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ak16u0
Calcite | Level 5

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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

4 REPLIES 4
ak16u0
Calcite | Level 5

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.

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

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...

 

Reeza
Super User

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. 

 

ak16u0
Calcite | Level 5

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

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