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

Hi, all,

 

I'm a beginner of SAS. I meet a problem recently. My data is that some events happen on Good (G), Bad (B), Fair (F) dates. If events happen on G, then dependent variable (Y) is (G=1), when others equal 0. If events happen on B, then dependent variable (Y) is (B=1), when others equal 0. I used the code as follows and generated two regrssion results now. However, I need to combine them into only one regression, that is, y is (G=1, B=2). Could anyone give me some suggestions? Thank you very much!!!!!!!

 

proc logistic descending data = logistic_data_dummy;
model Good(Event='1')= Size ROA EMI FSR FAM
Cement Semiconductor HM   Optoelectronic   othElectronic  Financial  Building  Textiles   Network   Trade /RSQ;
title "logistic_FAM";
output out= logistic_Good_FAM;
quit;
run;


proc logistic descending data = logistic_data_dummy;
model Bad(Event='1')= Size ROA EMI FSR FAM
Cement Semiconductor HM Optoelectronic othElectronic Financial Building Textiles Network Trade /RSQ;
title "logistic_FAM";
output out= logistic_Good_FAM;
quit;
run;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
It is called General Logistic Regression.
SAS can built it by default, no need two individual proc logistic.

I will recode  the response variable as the following due to the order of response variable is very important.

Oh. I just saw your code. You need change your data structure, combine all these f Good (G), Bad (B), Fair (F)
into one variable _Y and recode it as:

 if _Y='Bad'  then Y=1;
 if _Y='Fair' then  Y=2;
 if _Y='Good' then Y=3;


Then build mode as :

model Y= Size ROA EMI FSR FAM
Cement Semiconductor HM   Optoelectronic   othElectronic  Financial  Building  Textiles   Network   Trade /selection=stepwise  RSQ;


View solution in original post

4 REPLIES 4
Ksharp
Super User
It is called General Logistic Regression.
SAS can built it by default, no need two individual proc logistic.

I will recode  the response variable as the following due to the order of response variable is very important.

Oh. I just saw your code. You need change your data structure, combine all these f Good (G), Bad (B), Fair (F)
into one variable _Y and recode it as:

 if _Y='Bad'  then Y=1;
 if _Y='Fair' then  Y=2;
 if _Y='Good' then Y=3;


Then build mode as :

model Y= Size ROA EMI FSR FAM
Cement Semiconductor HM   Optoelectronic   othElectronic  Financial  Building  Textiles   Network   Trade /selection=stepwise  RSQ;


Ariel
Calcite | Level 5
Thank you! It works.
Reeza
Super User

The documentation for proc logistic has examples for both ordinal and generalized/nominal logistic regression. 

 

Read over both and decide what will work for you. The main difference is in interpretation not the code. 

 

PS I hope you have a lot of observations, that's a lot of variables to include. 

 

 

Ariel
Calcite | Level 5
Thank you! I will try.

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
  • 1644 views
  • 0 likes
  • 3 in conversation