logistic regression - Compare coefficients between categorical and numeric variables

by Pei Welkin   Last Updated July 12, 2019 05:19 AM

I have category (season, Time of day...) and numeric variables (temperature, humidity). I want to compare the coefficient to find out what variable has more impact on the dependent variable.

But the coefficients for the categorical variables are just against the reference category. I can't compare them with the numeric coefficients. How can I do that?



Answers 1


You can only compare coefficients once you've standardize columns with variance, otherwise comparison is meaningless. So what you can do is one-hot-encode your categorical data and standardize your full matrix data (containing both categorical & numeric data) per column - divide each column by its variance, you can also shift by the mean but this is not compulsory. This scales every column, and then when you run your logistic regression, all the weights will acount for the same so you'll be able to compare them.

Hope it helps, Vince

Vince.Bdn
Vince.Bdn
January 15, 2016 10:05 AM

Related Questions


Updated July 03, 2019 19:19 PM

Updated June 03, 2017 14:19 PM

Updated September 14, 2017 16:19 PM

Updated June 16, 2016 08:08 AM