[R] Plotting Question
Frank E Harrell Jr
fharrell at virginia.edu
Thu Jan 16 18:37:03 CET 2003
You might investigate the event.chart function in the Hmisc library (see http://hesweb1.med.virginia.edu/biostat/s/Hmisc.html)
On Thu, 16 Jan 2003 08:10:34 -0800
"Coate, Bruce" <bruce.coate at pfizer.com> wrote:
> For a clinical trial I am involved with, I would like a plot (for each
> subject) similar to the following which will indicate what drugs that
> subject was taking on each day during the study:
>
> Drug 1 [---] [----------------------]
>
> Drug 2 [-------------------------------------]
>
> Drug 3 [---------] [----------------------------]
> |--------------------------------------------------|
> 0 n
>
> Study Day
>
> I have thought about using strip plot, perhaps setting a flag each day the
> subject is on study (1 if drug x is taken on that day, NA otherwise). But
> that means I would have to create extra records for each subject because my
> data looks something like,
>
> Subject Drug Start Stop
> ------------------------------------------
> 1 1 5Jan2002 10Jan2002
> 1 1 12Jan2002 30Jan2002
> 2 2 15Feb2002 20Mar2002
> etc.
>
> Does anyone have a suggestion as to which kind of plotting function is best
> suited to this?
> Thanks.
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help
--
Frank E Harrell Jr Prof. of Biostatistics & Statistics
Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences
U. Virginia School of Medicine http://hesweb1.med.virginia.edu/biostat
More information about the R-help
mailing list