[R] Unable to get Legend with survplot rms package

Frank E Harrell Jr f.harrell at vanderbilt.edu
Mon Oct 26 23:54:08 CET 2009


Aric Gregson wrote:
> On Mon, 26 Oct 2009 15:10:42 -0700
> Frank E Harrell Jr <f.harrell at vanderbilt.edu> wrote:
> 
>>> survplot(survest(fit.example1), n.risk=T, conf='none',
>>> cex.n.risk=.85, dots=T, col='gray10', lty=2)
>> The argument to survplot should be a cph or psm or survfit object (or
>> a survest result on a psm object).
> 
> My apologies, all that and I made a typo. I have been doing:
> 
> survplot(survfit(fit.example1), n.risk=...)

But fit.example1 is a cph object.  It can go directly to survplot.

Best to take a break and read over more documentation.

> 
> Perhaps this is still incorrect?
> 
> It does plot, but no legend, so it is likely incorrect. Trying to plot
> the cph object does not work for me. I get an error about the datadist
> not including the data. I did make a datadist that is the master
> dataframe of which what I am trying to plot is a subset thereof.

Best to do that first, after require(rms).

Please read the posting guide also.

Frank

> 
> Thanks, Aric
> 
> 
> IMPORTANT WARNING:  This email (and any attachments) is only intended for the use of the person or entity to which it is addressed, and may contain information that is privileged and confidential.  You, the recipient, are obligated to maintain it in a safe, secure and confidential manner.  Unauthorized redisclosure or failure to maintain confidentiality may subject you to federal and state penalties. If you are not the intended recipient, please immediately notify us by return email, and delete this message from your computer.
> 


-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University




More information about the R-help mailing list