[R] survival curve for only certain values of a factor

Dieter Menne dieter.menne at menne-biomed.de
Thu Mar 13 08:20:44 CET 2008


Chang Liu <changisme <at> hotmail.com> writes:

> 
> data(aml)
> If I use instead dummy variables:
> 
> aml$x1 = (aml$x=="maintained")aml$x2 = (aml$x=="unmaintained")
> and I want to plot the survival curve using x1, x2, and I just want the 2
levels, rather than 4 curves from:

I don's understand what you want, but the first step is definitively incorrect
apart from the missint line break. The levels of aml are

"Maintained","Nonmaintained"

so both your "==" lead to all-false levels.

Dieter



More information about the R-help mailing list