dummy variable

#1
In linear regression, I have a categorical independent variable with 4 values (vrnt=1,2,3,4). I have created 4 dummy values (vrnt1 when vrnt=1 else=0, vrnt2 when vrnt=2 else=0, vrnt3=1 when vrnt=3 else=0, vrnt4=1 when vrnt=4 else=0). Reference is vrnt1. I should run linear regression with vrnt2, vrnt3, vrnt4 as independent variables in the model and do not include vrnt1? vrnt1 is automatically detected as reference variable?
 

fed2

Active Member
#2
i think probably the most expedient thing would be to let the software use whatever coding it likes, and you just focus on the means, p-values etc.

in R set factor(vrnt) and most models will automatically handle this.
in sas set as class variable

in SPSS destroy SPSS, then do one of the above options.
 

Karabiner

TS Contributor
#3
In linear regression, I have a categorical independent variable with 4 values (vrnt=1,2,3,4). I have created 4 dummy values (vrnt1 when vrnt=1 else=0, vrnt2 when vrnt=2 else=0, vrnt3=1 when vrnt=3 else=0, vrnt4=1 when vrnt=4 else=0). Reference is vrnt1. I should run linear regression with vrnt2, vrnt3, vrnt4 as independent variables in the model and do not include vrnt1? vrnt1 is automatically detected as reference variable?
A case with vrnt=1 shows three zeroes in vrnt2, vrnt3, vrnt4. Therefore it is the baseline.
The weight for e.g. vrnt3 shows what happens if you change from vrnt=1 to vrnt=3.

With kind regards

Karabiner