Re: [R] plotting regression line in with lattice

2012-01-14 Thread matteo dossena
Weidong, thanks for the suggestion, but i also need to show to which trt each point belongs to. I had my problem solved by the way. I've been told to add a group subscript object within the panel function, and than use panel.points to plot the original data as data points and panel.lines to dra

Re: [R] plotting regression line in with lattice

2012-01-13 Thread Weidong Gu
Hi, Since trt is a factor, you use it for indexing. try just delete in the code fill <- my.fill[combined$trt[subscripts]] Weidong Gu On Fri, Jan 13, 2012 at 11:30 AM, matteo dossena wrote: > #Dear All, > #I'm having a bit of a trouble here, please help me... > #I have this data > set.seed(4) >

[R] plotting regression line in with lattice

2012-01-13 Thread matteo dossena
#Dear All, #I'm having a bit of a trouble here, please help me... #I have this data set.seed(4) mydata <- data.frame(var = rnorm(100), temp = rnorm(100), subj = as.factor(rep(c(1:10),5)), trt = rep(c("A","B"), 50)) #and this model tha