Re: [R] xyplot: adding pooled regression lines to a paneled type="r" plot

2010-06-24 Thread Michael Friendly
Dennis Murphy wrote: Hi: Does this work for you? xyplot(distance ~ age | Sex, data = Orthodont, groups = Subject, main = 'Individual linear regressions ~ age', type = c('g', 'r'), panel = function(x, y, ...) { panel.xyplot(x, y, ..., col = gray(0.5))

Re: [R] xyplot: adding pooled regression lines to a paneled type="r" plot

2010-06-24 Thread Deepayan Sarkar
On Wed, Jun 23, 2010 at 11:35 PM, Michael Friendly wrote: > Thanks, Deepayan > > I read your presentation and understand how this works for the case you > presented, but I can't > get it to work for my case, where I want to superimpose model fitted lines > over individual > subject regression line

Re: [R] xyplot: adding pooled regression lines to a paneled type="r" plot

2010-06-23 Thread Dennis Murphy
Hi: Does this work for you? xyplot(distance ~ age | Sex, data = Orthodont, groups = Subject, main = 'Individual linear regressions ~ age', type = c('g', 'r'), panel = function(x, y, ...) { panel.xyplot(x, y, ..., col = gray(0.5)) panel.lmline(x, y

Re: [R] xyplot: adding pooled regression lines to a paneled type="r" plot

2010-06-23 Thread Michael Friendly
Thanks, Deepayan I read your presentation and understand how this works for the case you presented, but I can't get it to work for my case, where I want to superimpose model fitted lines over individual subject regression lines. Here's what I tried library(nlme) library(lattice) ##

Re: [R] xyplot: adding pooled regression lines to a paneled type="r" plot

2010-06-22 Thread Deepayan Sarkar
On Tue, Jun 22, 2010 at 9:30 AM, Michael Friendly wrote: > Consider the following plot that shows separate regression lines ~ age for > each subject in the Pothoff-Roy Orthodont data, > with separate panels by Sex: > > library(nlme) > #plot(Orthodont) > xyplot(distance ~ age|Sex, data=Orthodont, t

Re: [R] xyplot: adding pooled regression lines to a paneled type="r" plot

2010-06-22 Thread RICHARD M. HEIBERGER
Michael, Look at the ancova function in the HH package. ## install.packages("HH") ## if not there yet. library(HH) library(nlme) ## for the Orthodont data ancova(distance ~ age*Sex, data=Orthodont) ancova(distance ~ age+Sex, data=Orthodont) ancova(distance ~ age, groups=Sex, data=Orthodont) anc

[R] xyplot: adding pooled regression lines to a paneled type="r" plot

2010-06-22 Thread Michael Friendly
Consider the following plot that shows separate regression lines ~ age for each subject in the Pothoff-Roy Orthodont data, with separate panels by Sex: library(nlme) #plot(Orthodont) xyplot(distance ~ age|Sex, data=Orthodont, type='r', groups=Subject, col=gray(.50), main="Individual linear