[R] Putting regression lines on SPLOM

Andrew C. Ward s195404 at student.uq.edu.au
Fri Sep 5 12:29:37 CEST 2003


I wonder if it's as simple as the two dots ("..") in the
splom line rather than three?

Regards,

Andrew C. Ward

CAPE Centre
Department of Chemical Engineering
The University of Queensland
Brisbane Qld 4072 Australia
andreww at cheque.uq.edu.au


Quoting Ted Harding <Ted.Harding at nessie.mcc.ac.uk>:

> Thanks, Deepayan and Andy, for suggesting solutions.
> 
> Deepayan's solution seems to work beautifully, producing
> exactly
> what is wanted, as it stands:
> 
> On 05-Sep-03 Deepayan Sarkar wrote:
> > 
>   splom(log(1 + DF),
>         panel = function(x, y, ...) {
>             panel.xyplot(x, y, ...)
>             ok <- (x > 0) & (y > 0)
>             fm <- lm(  log(exp(y[ok]) - 1) ~ 
> log(exp(x[ok]) - 1) )
>             panel.abline(fm, ...)
>         }) 
> 
> However, there seems to be a problem with Andy Liaw's,
> applied to the
> same data:
> 
>   df.trans <- lapply(DF, function(x) log(1+x))  ## Do the
> transformation.
>   splom(df.trans, panel = function(x, y, ..) {
>         panel.xyplot(x, y, ...)
>         fit <- lm(log(exp(y)-1) ~ log(exp(x)-1), subset =
> x>0 & y>0)
>                 panel.abline(fit)
>         })
> 
>   Error in panel(x = as.numeric(z[subscripts, j]),
>                  y = as.numeric(z[subscripts,  : 
>                      ... used in an incorrect context
> 
> (which is the same error as I got trying an earlier
> suggestion of
> Deepayan's).
> 
> Anyway, much obliged for all the help!
> 
> Best wishes,
> Ted.
> 
> 
> ----------------------------------------------------------
----------
> E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
> Fax-to-email: +44 (0)870 167 1972
> Date: 05-Sep-03                                      
> Time: 10:06:39
> ------------------------------ XFMail
> ------------------------------
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>




More information about the R-help mailing list