On Oct 6, 2010, at 5:56 PM, Gerard Smits wrote:

Hi All,

I am running a scatter plot and trying to add a best fit line. I use an abline function, but get no line drawn over the points.

xyplot is Lattice
abline is base graphics

 I also get no error.  I arm using V 2.10.0 on Windows 7.

Here is my code, including the SAS transport file import:

Nope. Read the Posting Guide about attachments to the list. Nice try, though.


require (foreign)
require (chron)
require (Hmisc)
require (lattice)

clin  <- sasxport.get("y:\\temp\\subset.xpt")
attach(clin)


plot.new()
xyplot(jitter(b.lvef)~jitter(log.fgf),
main="Scatter Plot of Baseline Ejection Fraction\nby Log10 FGF-23",
      ylim=c(10,90),
      ylab="Ejection Fraction", xlab="Log10 FGF-23")

Instead consider:
?panel.lmline

Perhaps (untested in absence of data):

plot.new()
xyplot(jitter(b.lvef)~jitter(log.fgf), panel = function(x, y) {
          panel.xyplot(x, y)
           panel.lmline(x,y)
       },
main="Scatter Plot of Baseline Ejection Fraction\nby Log10 FGF-23",
      ylim=c(10,90),
      ylab="Ejection Fraction", xlab="Log10 FGF-23")



abline(lm(b.lvef~log.fgf))

Any suggestions appreciated.

Thanks,

Gerard
        [[alternative HTML version deleted]]


David Winsemius, MD
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to