From an online survey I gained a bunch of data. Some Items where answered with "Yes" or "No".
For my analysis I'd like to change the "Yes" into a 1 and the "No" into a 0.
How do I do that?
I tried the following: But that's obviously the wrong way around....
working_data$Schulabschluss_Mutter <- factor(working_data$F108, levels=c("Yes", "No",), labels=c(0,1))
I also tried this:
working_data$Schulabschluss_Mutte[working_data$F108 == "Yes"] <- 1
Didn't work either