Skip to content
Back to formatted view

Raw Message

Message-ID: <200402050958.18742.deepayan@stat.wisc.edu>
Date: 2004-02-05T15:58:18Z
From: Deepayan Sarkar
Subject: xypplot (lattice): colours of lines
In-Reply-To: <BAY8-F49WPXBemybNxv0006cb72@hotmail.com>

On Wednesday 04 February 2004 04:03, Umberto Maggiore wrote:
> Using data from a multicenter study with a parallel-group design comparing
> two treatments, I plotted each subject's time change of X after stratifying
> for center:
>
> xyplot(X ~ time | center, type="l", panel=panel.superpose, groups=subject)
>
> Now I want these lines to take different colours according to the variable
> "treatment". Any help?

Umm, you should already have lines colored differently by different 
'subject's. Do you want to further differentiate by treatment ? 

If that's so, there's probably no good way. You could try creating a new 
factor combining subject and treatment and use that as the groups argument, 
e.g.,

factor(paste(as.character(subject), as.character(treatment), sep = "/"))

Deepayan