Regressionsanalyse - NA as coefficients

Hey i have a problem with my regression analysis
I have 4 Treatment Groups, thus I've tried to build Dummy Variables for those. Then I wanted to put those dummies in the Regression as dependent Variables. I used the Trigger of my Survey to build those new Variables by recoding them ...

The problem is that I only get NA's as coefficients, which is super frustrating cause I don't find the problem

Dummy- Variablen für die Treatment - Gruppen erstellen, um eine Regression zu erstellen

Treatement 1

Rohdaten_xlsx$DT1 <- recode(Rohdaten_xlsx$c_0001,"1=1;2:4=0")
Rohdaten_xlsx$DT1

#Treatment 2
Rohdaten_xlsx$DT2 <- recode(Rohdaten_xlsx$c_0001,"2=1;1=0; 3:4=0")
Rohdaten_xlsx$DT2

#Treatement 3
Rohdaten_xlsx$DT3 <- recode(Rohdaten_xlsx$c_0001,"3=1;1:2=0;4=0")
Rohdaten_xlsx$DT3

#Treatement 4
Rohdaten_xlsx$DT4 <- recode(Rohdaten_xlsx$c_0001,"4=1;1:3=0")
Rohdaten_xlsx$DT4

#Regression mit Dummies --> Problem nur NA Werte
Model_Preise_2<- lm(Rohdaten_xlsx$KB_T1~ Rohdaten_xlsx$DHP1n+ Rohdaten_xlsx$DHG1n +Rohdaten_xlsx$DT1+ Rohdaten_xlsx$DT2+Rohdaten_xlsx$DT3)
summary(Model_Preise)

My professor said I Also can use as.factor in my regression, because this would build the dummies
-> I just don't know how to use these

Thanks for your help

If I recall correctly, regression analysis in R constructs dummy variables automatically so one does not create them manually as one used to do in SAS or SPSS.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.