[R] Plotting groupedData objects

Deepayan Sarkar deepayan at cs.wisc.edu
Fri Aug 27 00:22:41 CEST 2004


Quoting David Scott <d.scott at auckland.ac.nz>:

> On Thu, 26 Aug 2004, Deepayan Sarkar wrote:
> 
> > Quoting David Scott <d.scott at auckland.ac.nz>:
> > 
> > > 
> > > I am trying to create a plot similar to Figure 3.2 in Bates and
> Pinheiro.
> > > 
> > > I have repeated measurements on about 80 subjects from 2 treatment
> groups.  
> > > I would like to have the panels for the two treatment groups in separate
> > > groups and within those groups have the panels ordered on maximum value
> > > (as is the default).
> > > 
> > > I am ok with getting plots similar to Figs 3.1 and 3.2, but can't see how
> 
> > > to change the ordering of the panels to what I want.
> > > 
> > > Here is the definition of my groupedData object
> > > 
> > > RAWlmeData <- groupedData(RAW~Elapsed|ID,
> > >               data=RAWData,
> > >               labels=list(x="Elapsed time",y="Airways resistance"),
> > >               units=list(x="(hours)",y="cm H20/L/sec"))
> > > 
> > > I guess I could just plot the two treatment groups separately in turn but
> 
> > > I feel there is something I am missing.
> > 
> > My reading of page 105 suggests that you need to specify 
> > 'outer=<whatever your grouping factor is>'.
> > Have you tried that?
> > 
> I did try that. It produces Fig 3.3 with multiple lines giving the results 
> for each subject by treatment. With around 40 subjects per treatment 
> group, that isn't very attractive in my case.

I should have been more specific, but I thought this was clear enough in the
book. I was talking about specifying outer in the groupedData() constructor,
not in the plot() call. Have you tried _that_?

> I should also mention that I looked for on-line complements to Pinheiro 
> and Bates, and found MEMSS.tar.gz on 
> http://cm.bell-labs.com/cm/ms/departments/sia/NLME/MEMSS/index.html
> which promised scripts for the examples in the book but turned out to have 
> only chapters 1 and 2, and for S-PLUS rather than R (going on the .q 
> extension).

The R scripts are, naturally enough, bundled with the R version of the package.
They should be in the scripts/ subdirectory of your nlme installation.

Deepayan




More information about the R-help mailing list