On 6/7/07, Alan S Barnett <[EMAIL PROTECTED]> wrote:
> How do I add to a trellis plot the best fit line from a robust fit? I
> can use panel.lm to add a least squares fit, but there is no panel.rlm
> function.
It's not trellis, but it's really easy to do this with ggplot2:
install.packages("ggplot2", dep=T)
library(ggplot2)
p <- qplot(x, y, data=diamonds)
p + geom_smooth(method="lm")
p + geom_smooth(method="rlm")
p + geom_smooth(method="lm", formula="y ~ poly(x,3)")
see http://had.co.nz/ggplot2/stat_smooth.html for more examples.
Hadley
______________________________________________
[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.