s-news
[Top] [All Lists]

trellis graphs

To: <s-news@lists.biostat.wustl.edu>
Subject: trellis graphs
From: "Guy Forrester" <ForresterG@landcareresearch.co.nz>
Date: Fri, 23 May 2003 16:58:08 +1200
Dear All,
Using Splus 6.0 on a Windows 2000 machine
 
I am having a problem with the trellis graphs using the code below
 
xyplot(hsi ~ wt | vehicle,
        prepanel = function(x, y) prepanel.lmline,
        xlab = "Weight", ylab = "HSI",
        panel = function(x, y) {
           panel.grid(h=0, v= 0)
           panel.xyplot(x, y)
           panel.abline(lm(hsi~wt,na.action="">       },aspect = "xy")
 
 
There are 3 vehicles and the scatter plot for these turns out fine however the fitted lines I ask for in the panel.abline it plots the regression line for the first vehicle on all 3 plots. 
 
Could anyone indicate how to stop this happening, the same thing happens in the other not too dissimilar package.
 
Also in S-plus, but not the other package, one of the vertical axes is not aligned properly on the graph, can this be remedied also 
 
Many thanks in advance
 
Guy
 
data
vehicle wt hsi
PBS 22.7 0.035
PBS 17.9 0.056
PBS 19.8 NA
PBS 20.3 0.044
PBS 21.2 0.038
PBS 19.6 0.051
3%PVP 19 0.047
3%PVP 18.4 0.054
3%PVP 20.3 NA
3%PVP 18.9 0.048
3%PVP 19.6 0.051
3%PVP 21.7 0.051
CornOil 19.3 0.052
CornOil 18.3 0.049
CornOil 19 0.047
CornOil 19.4 0.052
CornOil 20 0.050
CornOil 19.1 0.052
 
 
 
 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
WARNING: This email and any attachments may be confidential and/or
privileged. They are intended for the addressee only and are not to be read,
used, copied or disseminated by anyone receiving them in error. If you are
not the intended recipient, please notify the sender by return email and
delete this message and any attachments.

The views expressed in this email are those of the sender and do not
necessarily reflect the official views of Landcare Research.

Landcare Research
http://www.landcareresearch.co.nz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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