I have a dataframe called SCWB from 2001. The variable YR_IMM captures the year of immigration for each individual (=observation).
1) I would like to delete the "don't know" (=9998) and "refuse" (=9999) observations. How should I go about this? I tried the dplyr package, but I can't figure out how to work an "continuous" variable (immigration years go from 1920 to 2000)
2) I would like to recode YR_IMM into "years spent in the US". Would this code be correct?
YRSinUS <- transform(SCWB, YR_IMM = 2001 - YR_IMM)