1
$\begingroup$

I have to do a binary logistic regression. I have a set of 7 independent variables. 4 of them are binary variables and the other 3 are categorical variables. The categorical variables are divided into 4 levels. For example, mode of payment: cash, internet banking, debit card, credit card.

I am confused whether I should make 4 columns with 0-1 dummies or just to code them 1, 2, 3, 4. What would be the right method for these variables

$\endgroup$
2
  • $\begingroup$ What package are you using? $\endgroup$
    – Andrew
    Mar 1, 2012 at 12:00
  • 3
    $\begingroup$ You probably meant, "7 explanatory variables". $\endgroup$
    – StasK
    Mar 1, 2012 at 12:08

1 Answer 1

4
$\begingroup$

Yes, you need to separate the categories into 0/1 variables, omitting one of them. In R, this would be done with as.factor(paymentmode). In Stata, it is done with i.paymentmode (which may have to be prefixed by xi: in older versions). Some people believe in different coding schemes for these categorical variables, but really it is just a matter of how you are going to read your output, and has no effect on estimation procedure itself.

$\endgroup$
1
  • 3
    $\begingroup$ Adding to the packages, in SAS you just need to use a CLASS statement in PROC LOGISTIC. $\endgroup$
    – Peter Flom
    Mar 1, 2012 at 14:05

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.