[R] Plotting groupedData objects
David Scott
d.scott at auckland.ac.nz
Fri Aug 27 03:19:15 CEST 2004
On Thu, 26 Aug 2004, Deepayan Sarkar wrote:
> 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.
>
Thanks Deepayan. I didn't read that section closely enough. Defining an
outer factor in the constructor did what I wanted.
I also found the scripts as you suggested although they didn't include
code for the production of Fig 3.2 as far as I could see.
David Scott
_________________________________________________________________
David Scott Department of Statistics, Tamaki Campus
The University of Auckland, PB 92019
Auckland NEW ZEALAND
Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000
Email: d.scott at auckland.ac.nz
Graduate Officer, Department of Statistics
More information about the R-help
mailing list