Re: [R] Plotting 1 covariate, 3 factors

2009-10-08 Thread Paul Chatfield
Cheers guys that's helpful. Doug, you're right, my code for ff should have been for (i in 1:length(y)) {if (f1[i]==after f3[i]==1) ff[i]-1, after else if(f1[i]==after f3[i]==2) ff[i]-2, after else if(f1[i]==before f3[i]==1) ff[i]-1, before else if(f1[i]==before f3[i]==2) ff[i]-2, before}

Re: [R] Plotting 1 covariate, 3 factors

2009-10-08 Thread Deepayan Sarkar
On Thu, Oct 8, 2009 at 1:57 AM, Paul Chatfield p.s.chatfi...@rdg.ac.uk wrote: Cheers guys that's helpful.  Doug, you're right, my code for ff should have been for (i in 1:length(y)) {if (f1[i]==after f3[i]==1) ff[i]-1, after else if(f1[i]==after f3[i]==2) ff[i]-2, after else

Re: [R] Plotting 1 covariate, 3 factors

2009-10-08 Thread Paul Chatfield
That's solved it. Superb! All you probably need is to make f2 a factor (e.g., y ~ factor(f2) | f1). Otherwise dotplot() doesn't know which one to treat as categorical. -Deepayan -- View this message in context:

Re: [R] Plotting 1 covariate, 3 factors

2009-10-07 Thread Richard M. Heiberger
## Paul ## I think you are looking for interaction2wt y - rnorm(36) f1 - rep(c(after, before), 18) f2 - rep(1:3, 12) f3 - rep(1:2, each=18) ## your definition of ff was faulty. It gave a constant. f3.f1 - interaction(f3, f1) interaction.plot(f3.f1, f2, y) f2 - factor(f2) f3 - factor(f3) ##

Re: [R] Plotting 1 covariate, 3 factors

2009-10-07 Thread Douglas Bates
I'm not sure if this is exactly what you are looking for but I would generally create an interaction plot using the lattice 'dotplot' with type = c(p,a) so I get both the original data and the lines joining the averages for the different factor levels. I also prefer the horizontal orientation to