I'm trying to calculate a multivariate linear regressions in which my independent variables are qualitative but Im not sure im doing it right
the code I have so far is
model_1.a <- lm(formula = V34 ~ no.work + common.poor.housing + no.degree, data = df)
however my variables no.work, common.poor.housing and no.degree where created with the within() function like so:
df <- within(cr.svy, {
degree <- as.numeric(V6==4)
no.degree <- as.numeric(V6 == 1| V7 == 2 | V7 == 3)
work <- as.numeric(V7==1)
no.work <- as.numeric(V7 == 2)
common.poor.housing <- as.numeric(V14 == 1 | V14 == 2)
uncommon.poor.housing <- as.numeric(V14==3 | V14 == 4)
degree[is.na(V6)] <- NA
no.degree[is.na(V6)] <- NA
work[is.na(V7)] <- NA
no.work[is.na(V7)] <- NA
common.poor.housing[is.na(V14)] <- NA
uncommon.poor.housing[is.na(V14)] <- NA
})
and are either 1 or 0 and Im not sure if the results are what Im looking for, Im trying to test the relationship between my dependent variables and the no.work, common.poor.housing and the no.degree variable I created