Hi: See below.
On Wed, Oct 6, 2010 at 2:56 PM, Gerard Smits <g_sm...@verizon.net> 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. 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: > > 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") > > abline(lm(b.lvef~log.fgf)) > > Try this: xyplot(jitter(b.lvef)~jitter(log.fgf), type = c('p', 'r'), main="Scatter Plot of Baseline Ejection Fraction\nby Log10 FGF-23", ylim=c(10,90), ylab="Ejection Fraction", xlab="Log10 FGF-23") Type 'p' plots the points, 'r' the least-squares regression line. The set of allowable types is found on p. 75 of the Lattice book. HTH, Dennis Any suggestions appreciated. > > Thanks, > > Gerard > > > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. > [[alternative HTML version deleted]] ______________________________________________ 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.