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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2025 views
  • 1 like
  • 3 in conversation