BookmarkSubscribeRSS Feed
spasico
Calcite | Level 5

I tried to run fixed effect in logistic regression, fixed effects are industry and year.

code are as following, I think there is some syntax error for model.

 

/////

PROC LOGISTIC DATA=ipo;
strata industry year;
model y = x1 x2 industry year / rsquare link=logit;
run;
quit;

/////

 

Is there any way to solve this?

7 REPLIES 7
Rick_SAS
SAS Super FREQ

Hard to say without seeing the log. Are you intentionally trying to perform stratified (conditional) regression? If not, use the CLASS statement instead. The doc says "The STRATA statement in PROC LOGISTIC is used to define variables that identify matched sets of observations so that these matched sets can be analyzed using conditional logistic regression, not the usual unconditional logistic regression."

 

If you have many years and many industries, the stratified regression is probably taking a long time.

spasico
Calcite | Level 5

I see. Thanks a lot!

Xiyuan
Fluorite | Level 6
sorry if we use CLASS, is it takes a long time and output a long list of result?
what if we only care about the coefficients of x1 and x2 ?
Rick_SAS
SAS Super FREQ

If you only care about X1 and X2, then create a model that contains only those variables:
model y = x1 x2;

 

Xiyuan
Fluorite | Level 6
but what if I want to control the fixed effect ,like industry (format is char) and year (format is numerical), as well as cluster the standard error? can you give a complete code for me? thanks a lot
Rick_SAS
SAS Super FREQ

This thread is from 2020. If you have a new question, you can start a new thread in which you post your data, any code you are using, and specify what you are trying to achieve. 

Xiyuan
Fluorite | Level 6
thanks i got it

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