0

I would like to add age as a predictor for my regression, but I would also like to make it a binary categorical predictor with a cutoff of 18 years of age.

I would like to do this because I suspect that age as a continuous predictor is loosely related to my dependent variable (I don't want to lose any information by eliminating it completely as a continuous variable), but there will be a much stronger categorical relationship.

User0
  • 287
  • 2
  • 16

1 Answers1

1

People do often use binary categorical variables as 0/1 numeric variables in regression, yes. Note however you are almost certainly violating the i.i.d. gaussian assumption on regression errors in that case. But people still do it. An alternative is to learn two different regression models, one for people under 18 and one for people over 18. However this will reduce your data support, so if the number of data points for either group is too close to the number of remaining variables then that is not a good idea.

user2566092
  • 26,142
  • I am using this model strictly for predictive purposes. – User0 Jul 14 '14 at 22:02
  • @Biology2795733 that's fine, I don't see how it affects the pertinence of my answer? – user2566092 Jul 14 '14 at 22:05
  • I thought that i.i.d. referred to the assumption that the predictor variables are independent of one another. – User0 Jul 14 '14 at 22:08
  • 1
    No, it's an assumption that when you do your regression and get the errors between the actual and predicted values of the dependent variable, those errors are assumed to be i.i.d. Gaussian. This almost certainly cannot be the case if some of your predictors are categorical. But people still do it anyway (use binary 0/1 categorical variables directly in regression). – user2566092 Jul 14 '14 at 22:21
  • So is it reasonable to include age as both a categorical AND continuous predictor? – User0 Jul 14 '14 at 22:24
  • 1
    Sure, you can do that and it's not a problem. In that case you are doing non-linear regression because you are including two different numerical summaries of your age variable, which are not linearly related. People often do non-linear regressions e.g. by including powers of variables as additional variables (which would be considered "polynomial regression") – user2566092 Jul 14 '14 at 22:38