# Should I categorise my continuous variable for use in binary logistic regression

DV: work response dummy, (1=household increased work, 0=hh did not increase work) IV: family size (continous variable)

I am doing a logistic regression on these variables. My concern is that I know when using categorical predictors I need to make sure there are no empty cells. However, I'm not sure exactly how the logistic regression works with a continous predictor. I know that it will look at the change in the odds of the DV resulting from a one unit change in the continous predictor. However, does it treat the continuous variable in a similar way. Should I worry about empty cells in this case. For example, there may be only one family with 17 members. I hope my question is reasonably clear. I appreciate any help you could give me. Thank you.

• If you include a continuous predictor in your logistic regression, the exponentiated coefficient represents the odds ratio for one unit change in the predictor. Often, one unit isn't meaningful and you want the odds ratio for, say, 10 units. To calculate this, just exponentiate the coefficient multiplied by 10: $OR_{10}=\exp(\beta\cdot 10)$. – COOLSerdash May 27 '13 at 20:09
• It is not generally advisable to categorize continuous variables. It may help you to read my answer here: how to choose between anova and ancova in a designed experiment, especially below update. To address your specific concern, it does not matter if you have only 1 family w/ 17 members. – gung - Reinstate Monica May 27 '13 at 20:47
• This would help you in making decision ww1.cpa-apc.org/publications/archives/cjp/2002/april/… – Chirag Mar 25 '18 at 17:22

This can cut two ways, but mostly one. In logistic regression, as with any flavour of regression, it is fine, indeed usually better, to have continuous predictors.

Given a choice between a continuous variable as a predictor and categorising a continuous variable for predictors, the first is usually to be preferred. At the crudest level, you are just throwing away information by categorising a continuous variable. There is discussion in several places. Frank Harrell in his Regression modeling strategies (New York: Springer, 2001; Cham, Springer, 2015) has a nice treatment of the issue and gives references.

Also, there is not really a equivalent of empty cells to worry about. Values of family size, which is your leading example here, may not exist for 13, 14, 15, 16 members, or for that matter for 42 or 420. This is no more a problem than using persons' height as a predictor and not having someone 3 metres tall in your dataset.

It's true that the same problem may bite in terms of outliers, but that can happen with the categorical solution too. If some points are 0 and a few are 1 or a very few are 5, that's possibly an outlier situation too.

The qualification is that by entering a predictor as is you are implying that its effect is additive and linear. But that's not a fatal objection: just consider adding an interaction term or transforming it, as appropriate. Or a treatment in terms of splines: the book just cited is rich in examples.

It is true that reducing an ordinal or even continuous variable to dichotomous level loses a lot of information, but this is a concern for the dependent variable (i.e. dichotomizing a continuous dependent variable) in logistic regression. For continuous predictors (independent variables), logistic regression assumes that predictors are linearly related to the log odds of the outcome (an assumption known as “linearity of the logit”). If this assumption is violated, logistic regression underestimates the strength of the association and rejects the association too easily, that is being not significant (not rejecting the null hypothesis) where it should be significant. The Box–Tidwell test can be performed to assess linearity in the log(odds) as required by logistic regression. If linearity is not observed, categorical scales for the continuous predictor can be examined on the basis of quartiles and logit graphs. Fractional polynomials and spline functions can also be used to model continuous predictors. For a good discussion of methods to examine the scale of a continuous covariate in the logodds, I suggest reading chapter 4 of Applied Logistic Regression, 3rd Edition, by Hosmer, Lemeshow, and Sturdivant.

• Box-Tidwell a much more indirect approach and not nearly as flexible as just using regression splines in the initial model specification (they are not that "fancy"). And please don't examine any categorical molestation of continuous variables. – Frank Harrell Sep 9 '15 at 16:10