Try: > sex <- factor(sample(c("M", "F"), 10, replace=TRUE), levels=c("M", "F", "I")) > sex [1] F F M F F F M M M F Levels: M F I > sex2 <- sex[, drop=TRUE] > sex2 [1] F F M F F F M M M F Levels: M F
HTH, Andy > From: Neil Leonard > > Hi, > > I have imported some data to R from stata and my factor > variables have > an Indeterminate level which I don't really want. For example the > variable sex has the levels Male, Female and Indeterminate. There are > no 'Indeterminate' values in the data. Can somebody tell me > how to get > rid of this level as it restricting my cox ph model. > > Thanks > Neil > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > > ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html