Skip to content
Prev 5662 / 20628 Next

Library (lattice)

Dear Shankar,

It seems like this is more of a question for R-help than mixed models,
but in any case, I think this does what you want.  See comments in the
code for explanation.


HTH,

Josh

############################
## Only using part of your data
dat <- read.table(textConnection("
ID  X    Y1  Y2
1  0.5  0.4   1
1  0.2  0.1   2
1  1      2    3
1  4      5    4
2  2.5   3    5
2  3      4    6
2  0.5  0.4   7
2  0.2  0.1   8
2   1      2   9
2   4      5   8
2  2.5   3    7
2  3      4    6
3  0.5  0.4  5
3  0.2  0.1  4"), header = TRUE)
closeAllConnections()

## Sorting will making the lines prettier
dat <- dat[order(dat$ID, dat$X), ]
## Convert ID to a factor to show its labels
dat$ID <- factor(dat$ID)

require(lattice)
## type = "l" specifies lines rather than points
xyplot(log(Y1) + log(Y2) ~ X | ID, data = dat, type = "l",
  layout=c(0,4))
############################
On Mon, Mar 21, 2011 at 8:16 PM, Shankar Lanke <shankarlanke at gmail.com> wrote: