2
$\begingroup$

When does it make sense to log-transform input variables in multi-variable logistic regression? The transformation improves model metrics a little bit, but I'm not sure how to justify it and whether it is considered as an additional degree of freedom.

EDIT

There are several questions here about interpretation of models that are based on log-transformed data ([1], [2]). I'm interested in the question "when do we need to log-transform data?"

$\endgroup$
4
$\begingroup$

With respect to the input/predictor variables, the same general rule applies as for standard linear regression: you want transformations of input variables such that they bear linear relations to the output variable. The only difference here is that the output variable happens to be a log-odds.

Similarly, the issues of how this affects degrees of freedom and statistical inference are the same as for standard multiple regression. The transformations per se don't cost degrees of freedom if they are chosen without regard to the relations to the output variable. Insofar as the transformations are chosen by looking at the data, then that should be taken into account in subsequent inference. Harrell's Regression Modeling Strategies text and related on-line references provide much more detailed information.

$\endgroup$
  • $\begingroup$ @NickCox : fixed careless error; thanks for the helpful edits. $\endgroup$ – EdM Jan 14 '16 at 20:06
2
$\begingroup$

Generally, logistic regression assumes that logit of probability dependes linearly on predictors. So you need a transformation when dependence is not linear (and after transformation it is linear or close to linear). Most common one is logarithm, others that are used include powers, polynomials, splines.

So in practice you may investigate whether dependence is linear or not, I think that you can use Box-Tidwell test or just assess model fit with various options. Logarithmic transform is also often suggested by interpretation of variables in the model (loosely speaking when you suspect that what matters is relative change in the variable, not absolute one).

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.