s-news
[Top] [All Lists]

abline for multiple trellis panels

To: "'s-news@lists.biostat.wustl.edu'" <s-news@lists.biostat.wustl.edu>
Subject: abline for multiple trellis panels
From: "Dakin, Jonathan" <j.dakin@imperial.ac.uk>
Date: Tue, 21 Oct 2003 12:56:58 +0100
I'm trying to produce regression lines on each panel of a trellis using
panel.abline.

I can make it work when there is a single plot, by inserting:

panel=function(x,y,...){panel.xyplot(x,y,...);  panel.abline(lm(y~x))}

into the script.  Could anyone advise me on how to make it work for each
panel of a multi-panel trellis ?

I've tried replacing the regression object with:
lmList(y~x | z, data=df          )

where z is the conditioning variable, but I can't work out how to pass the
parameters into the panel function.  Can anyone help ?  Many thanks.

(Splus 6 release 2)

Jonathan Dakin
Imperial College

<Prev in Thread] Current Thread [Next in Thread>