1
$\begingroup$

Suppose that in a linear regression, some of the continuous variables (such as number of pills taken each day) have small discrete values. For e.g. the number of pills taken each day can take values 0,1,2,3.

Would it be better to treat these continuous variables as categorical or ordinal variables? What should be the appropriate approach?

Thanks.

$\endgroup$
3
  • 1
    $\begingroup$ I wouldn't say that number of pills taken in a day is continuous. In fact, I would guess that it's Poisson distributed (count data, i.e. discrete), with the interval time between pills taken as continuous (exponential). $\endgroup$ – Eric Peterson Apr 24 '13 at 2:44
  • $\begingroup$ "number of pills" isn't continuous, it's discrete, unless you can take 0.153847 of a pill. But that doesn't mean you should treat them as categorical or ordinal. $\endgroup$ – Glen_b Apr 24 '13 at 3:44
  • $\begingroup$ Thanks for clarifying the continuous/discrete bit. The word continuous was a wrong usage in this context. $\endgroup$ – user22119 Apr 24 '13 at 12:51
1
$\begingroup$

Your question suggests that the variable(s) at hand are your independent variables. If not (or if one of them is the dependent variable), you might want to take up Clark's advice and do Poisson regression.

For the independent variables: assuming you're looking at association, you can simply test whether it is necessary to treat the variable as categorical. If you compare a model: $$ out = \beta_0 + \beta_1 I(x=1) + \beta_2 I(x=2) + \epsilon $$ (have as many dummies as you need for the variable at hand) it's straightforward to see that this model: $$ out = \beta_0 + \beta_1 x + \epsilon $$ Is a submodel (just assume $\beta_2==2\beta_1$). This allows for a likelihood ratio test that will either indicate that you need the more complex model (categorical interpretation) or (given your sample size makes the power of the test trustworthy) warrant using the simpler numerical interpretation.

This still holds if the model contains other covariates (just keep those the same in the two models you're comparing.

Note: besides other details left out in the above, at the least you should be aware that adding more tests like this theoretically requires some form of multiple testing correction. Fortunately (?) no one ever does this, so you can get by without - just be aware.

$\endgroup$
1
  • $\begingroup$ Thanks for your response. Yes the variables at hand are independent variables and it slipped my mind that the two model that you showed are so similar. $\endgroup$ – user22119 Apr 24 '13 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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