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


Hello,

I am using the utility bode for custom code in EM to export a scored data set form a process flow. The variables that i get from the best model (logist regression) are ok (e.g. probabilities of primary and secondary event, predicted target etc) but i don;t get the logit (log odds) from the regression model. How can i get this variable also?

Thnaks in adavnce,

Andreas

1 ACCEPTED SOLUTION

Accepted Solutions
andreas_zaras
Pyrite | Level 9

Thanks for your answer. This can be a solution but there must be an option to produce automatically the logits. EM produces so much output that i cannot imagine that it can;t produce the logits. I hope someone can answer. A turnaround that i just thought is to produce the log odds (logits) using the sas code node in the utility tab. Since the probability of the primary event is reported i guess we can produce it by a data step using an assignment statement to produce log(prob_b1/(1-prob_b1)). The expression can be assigned to a variable called logit.

Let us see if the automatic way is done!

Thnaks again 

View solution in original post

2 REPLIES 2
adjgiulio
Obsidian | Level 7

I'm interested in seeing if someone can answer your questions. I've looked into this same question myself not long ago. A logistic regression in EM is run through PROC DMREG. When you look at DMREG's documentation it doesn't say anything about an option to export coeffiecients. The workaround I found, which is no good if you need an automated solution but worked for what I had to do that one time, is the following:

-go to the results of your regression.

-by default EM shows an Effect Plots chart. Highlight that chart.

-now go to View->Table. This will open up a table that has a few pieces of information on your inputs, including their coefficients which you can use to calculate odds.

-you can now select all the data in the table and paste it in Excel, or you can save the table as a SAS table (File->Save as, after having highlighted the table)

G

andreas_zaras
Pyrite | Level 9

Thanks for your answer. This can be a solution but there must be an option to produce automatically the logits. EM produces so much output that i cannot imagine that it can;t produce the logits. I hope someone can answer. A turnaround that i just thought is to produce the log odds (logits) using the sas code node in the utility tab. Since the probability of the primary event is reported i guess we can produce it by a data step using an assignment statement to produce log(prob_b1/(1-prob_b1)). The expression can be assigned to a variable called logit.

Let us see if the automatic way is done!

Thnaks again 

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!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 909 views
  • 3 likes
  • 2 in conversation