Dear Statalist,

I have some categorical variables, for example bmi_cat (BMI category) : 1=low, 2=normal, 3=high. I have the dependent variable dep_var as 0, 1.

I want to run the logistic regression of dep_var on bmi_cat where bmi_cat = 1 will be the reference category, and I want to use stepwise method.

I am getting an error after running this

sw, pe(0.2): logistic dep_var i.bmi_cat

The error is

factor variables and time-series operators not allowed
r(101);

Is there any other way?

Thank you in advance.