G''day I''ve been performing an analysis of some data by a follow the leader method (Bad I know but it seems to work and I think I understand all the steps now) and I''ve run into a problem. The analysis is for all practical purposes identical to the non-linear mixed effects analysis performed on Ludbrooks Rabbit data in the second edition of Venables & Ripley (page 315--321). I have the stats pretty much done and have estimates for all the model parameters from the nlme object. Now I want to add the fitted lines to my coplot of the data in the manner of figure 10.3. How would I do this? I owuld guess that I use the lines function or the panel function but I can''t find an index varibale to tell me what panel I''m in. Any suggestions? John Walker -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 16 May 2000, John S. Walker wrote:> I''ve been performing an analysis of some data by a follow the leader > method (Bad I know but it seems to work and I think I understand all the > steps now) and I''ve run into a problem. The analysis is for all practical > purposes identical to the non-linear mixed effects analysis performed on > Ludbrooks Rabbit data in the second edition of Venables & Ripley (page > 315--321). I have the stats pretty much done and have estimates for all > the model parameters from the nlme object. Now I want to add the fitted > lines to my coplot of the data in the manner of figure 10.3. How would I > do this? I owuld guess that I use the lines function or the panel function > but I can''t find an index varibale to tell me what panel I''m in. Any > suggestions?You need to fake it. There is an example in the 3rd edition R scripts, which for the Rabbit data becomes coplot(seq(0,40, len=60) ~ log(Dose) | Animal * Treatment, Rabbit, show.given=FALSE, panel = function(x, y, ...) { ind <- round(1 + 59*y/40) lines(spline(x, fitted(R.nlme2)[ind])) points(x, Rabbit$BPchange[ind]) }) coplot does not have the subscripts = T argument that Trellis has. I think we could usefully add it (since `lattice'' seems nowhere visible yet), and I will do so for 1.1.0. Also, the handling of xlab/ylab differs a bit from the S original, and I will take a look. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Brian Ripley wrote ....> coplot does not have the subscripts = T argument that Trellis has. > I think we could usefully add it (since `lattice'' seems nowhere visible > yet), and I will do so for 1.1.0.That would be very useful.> Also, the handling of xlab/ylab differs > a bit from the S original, and I will take a look.In coplot() as it stands, xlab and ylab control the labels for the "given" (or conditioning) values, which seems to me odd terminology. It is not possible to directly control the x and y labels. Provide it does not break too much existing code, I''d plump for given.xlab etc. for labelling the given values, using xlab and ylab of the x and y-axis labels for the individual panels. John Maindonald John Maindonald email : john.maindonald at anu.edu.au Statistical Consulting Unit, phone : (6249)3998 c/o CMA, SMS, fax : (6249)5549 John Dedman Mathematical Sciences Building Australian National University Canberra ACT 0200 Australia -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Wed, 17 May 2000, John Maindonald wrote:> Brian Ripley wrote > > .... > > coplot does not have the subscripts = T argument that Trellis has. > > I think we could usefully add it (since `lattice'' seems nowhere visible > > yet), and I will do so for 1.1.0. > > That would be very useful.It''s now in, and was easy to do.> > Also, the handling of xlab/ylab differs > > a bit from the S original, and I will take a look. > > In coplot() as it stands, xlab and ylab control the labels for the > "given" (or conditioning) values, which seems to me odd terminology. > It is not possible to directly control the x and y labels. Provide > it does not break too much existing code, I''d plump for given.xlab > etc. for labelling the given values, using xlab and ylab of the > x and y-axis labels for the individual panels.What I chose to do was to make the first component of xlab and ylab the x and y-axis labels for the array of panels (which is what they are in S, and in xyplot), and an optional second component the labels for the conditioning values. Anything like this would break some existing code, but the current version breaks my S code! Re-using x/ylab might give sensible answers on old R code, I thought. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Another point is that one would like to be able to control the space left for the margins in coplot(). This is one of a number of thinks I have been meaning to look at when I get a chance. John Maindonald email : john.maindonald at anu.edu.au Statistical Consulting Unit, phone : (6249)3998 c/o CMA, SMS, fax : (6249)5549 John Dedman Mathematical Sciences Building Australian National University Canberra ACT 0200 Australia -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._