Displaying 1 result from an estimated 1 matches for "b20c".
Did you mean:
20c
2012 Oct 24
2
Recode function car package erases previous values
...a new variable based on values of other variables. The variable is called pharm. It basically takes the numeric code of 1 as yes and 0 to be No from the variable B20_C1 (a question on a survey). However, I would also like to have a level for non-respondents and these are captured in the variable nr.B20C, which is a 1 when there is a non-response on the whole group of variable B20_C1 to B20_C5. So ultimately the variable pharmacy will have three levels,
Yes No and no resp.
See below what happens
> pharm<-as.factor(recode(B20_C1,"1='Yes';0='No'"))
> table(pharm)...