Re: [R] Question about which kind of plot to use

From: Deepayan Sarkar <deepayan.sarkar_at_gmail.com>
Date: Wed, 19 Dec 2007 16:40:37 -0800

On 12/19/07, Dylan Beaudette <dylan.beaudette_at_gmail.com> wrote:
> On Wednesday 19 December 2007, Max wrote:
> > Hi Everyone,
> >
> > I've got a question about data representation. I have some psychometric
> > data with 5 scores for 15 different groups. I've been asked to show
> > some kind of mean plots. The data below is the mean and SD for a given
> > group, unfortunately my employer doesn't want me posting full datasets.
> >
> > :(
> >
> > The groups V,W,X,Y,Z are divided into Bottom, (B), Middle (M) and Top
> > (T). An example of my data is shown below.
> >
> > Score 1
> > Mean SD
> > B M T B M T
> > V 86.9 13.0 88.8 16.9 2.0 10.5
> > W 16.1 96.1 17.7 2.2 4.6 1.7
> > X 50.7 61.1 74.7 4.7 3.7 7.6
> > Y 68.5 99.7 37.6 6.0 8.0 2.3
> > Z 92.7 22.3 69.4 6.5 1.2 2.2
> >
> > What I did before was a standard mean plot:
> >
> > plotMeans(w$score1, w$Factor,
> > error.bars="sd",xlab="Factor",ylab="Score",main="Group W Score 1 Plot")
> >
> > However, with 15 groups and 5 scores this turns into 75 individual
> > graphs. Is there a way to layer mean plots? Or show several mean plots
> > in the Same graph? Any ideas or suggestions would be great.
> >
> > thanks,
> >
> > -Max
> >

>

> How about a lattice plot using panels ? plot the distribution of each score
> (box and whisker style), using a panel for each group?
>

> a <- rnorm(100)
> b <- rnorm(100)
> c <- rnorm(100)
> d <- rnorm(100)
>

> library(lattice)
> new <- make.groups(a,b,c,d
>

> new$grp <- rep(gl(5,20, labels=c('A','B','C','D','E')), 4)
>

> bwplot(data ~ which | grp, data=new)
>
> Not quite means, but close!

And

demo("intervals", package = "lattice")

shows you how to incorporate confidence intervals.

-Deepayan



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 20 Dec 2007 - 00:43:42 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 20 Dec 2007 - 06:30:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.