Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

I have a data set with 3 continuous variables and 3 categorical variables. I know that I have to create dummy variables for categorical variables but I am wondering if it is a must to do that for all 3 categorical variables in this case?

share|improve this question
3  
If you want to include all the 3 categorical variables in your model, then yes. – andrea Apr 7 '12 at 17:36

2 Answers

R does this for you, as @Julie said. But so do SAS and SPSS (and probably all other major stats packages).

Be careful, though, as different packages have different defaults for the way they code categorical variables. In R, see this document dummy coding is the default in lm() for unordered factors; the same is true in SAS PROC GLM, but unfortunately, PROC LOGISTIC uses effect coding by default.

share|improve this answer

One advantage (out of many) of using R is that it takes care of this problem for you -- no need to assign dummies (just make sure the categorical variables are entered as strings instead of numbers).

Some basics: Multiple regression in R

share|improve this answer
Hi! thanks for the reply. Do you mean that I can just run a regression model using those categorical variables without dummies? Sorry I am still kinda new to stats! – Daryl Apr 7 '12 at 17:45
@Daryl that's definitely what I mean! With R, the problem of assigning dummy variables is taken care of for you! – Julie Apr 7 '12 at 18:33
alright! thank you very much for the help! – Daryl Apr 7 '12 at 19:27
@Daryl feel free to accept the answer. :) – Julie Apr 7 '12 at 20:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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