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;
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;
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;
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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.