[R] Plotting regression lines and points from lm using lattice

Deepayan Sarkar deepayan.sarkar at gmail.com
Wed Dec 17 18:49:16 CET 2008

On 12/17/08, Javier PB <j.perez-barberia at macaulay.ac.uk> wrote:
>  Dear R-users,
>  Sorry if someone came out with a similar question but after one day of
>  searching I am giving up:
>  Does anyone know how to plot the original points used in a lm model and the
>  set of resulting regression lines generated by the model?
>  This is how I do it using the "plot" and "lines" functions but I would like
>  to do it using lattice and I cannot find a way to plot in the same panel
>  points and lines that come from different datasets.
>  Note: I would like to use this sort of "predict" approach rather than using
>  the regression coefficients of the model as in complex models I get confused
>  when I have to combine the coefficients to build up each regression line.

Take a look at



More information about the R-help mailing list