Start with something like this:

pairs(iris, panel= function(x,y,...){
        points(x,y);
        abline(lm(y~x))})

Then substitute in your data and extra args and any other enhancements
you want.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
 
 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Alan S Barnett
> Sent: Thursday, July 19, 2007 3:51 PM
> To: [email protected]
> Subject: [R] Trend lines on a scatterplot matrix
> 
> I'm using pairs() to generate a scatterplot matrix;
> 
> pairs(~ 
> Fuzzy.gray.white.ratio+Fuzzy.gw.t.score+AgeWhenTested+signal_m
> ean.noise,
>       data=datam,subset=status=="control",main="Controls",
>         labels=c("G/W","Peak Separation","Age","S/N"))
> 
> 
> How can I add regression lines to the plots?
> 
> ______________________________________________
> [email protected] 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.
>

______________________________________________
[email protected] 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