On 03/26/2014 05:35 AM, Si Qi L. wrote:
Hi, it's so urgent that I really need your help on R. This following is
part of my data, do u know how to create a dummy coding about it in R? My
control group is Owner occupier. Many thanks for your big help!!!:)
*AppHomeStatus*
Owner occupier
Living with parents
Living with parents
Private tenant
Private tenant
Private tenant
Council tenant
Owner occupier
Owner occupier
Living with friends/family
Hi Si Qi,
the above doesn't make a lot of sense, but I'll guess that you want to
convert your AppHomeStatus variable to a factor with "Owner occupier" as
the first level. Assume that the data frame is named "mydata".
mydata$AppHomeStatus<-factor(mydata$AppHomeStatus,
levels=c("Owner occupier","Living with parents",
"Private tenant", "Living with friends/family"))
If you have more levels, make sure that you add them to the "levels"
argument.
Jim
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.