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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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