Hello: Im a novice user of R. I was triying develop graphs with plot.lm or plot(gam) but I dont obtain a desire result. I would like to create a plot from lm, glm and gam objects showing: 1- Fit curve 2- Raw data of predictor and response variables as points. 3- Confidence intervals (95%) Anybody can help me? -- David Nogu?s Bravo Functional Ecology and Biodiversity Department Pyrenean Institute of Ecology Spanish Research Council Av. Monta?ana 1005 Zaragoza - CP 50059 976716030 - 976716019 (fax)
Have you considered "predict.lm"? The documentation includes an example that will produce predicted lines plus both confidence and tolerance intervals. Follow that with "points(x, y)" to add the data points. hope this helps. spencer graves David Nogu?s wrote:> Hello: > > Im a novice user of R. I was triying develop graphs with plot.lm or > plot(gam) but I dont obtain a desire result. I would like to create a > plot from lm, glm and gam objects showing: > > 1- Fit curve > 2- Raw data of predictor and response variables as points. > 3- Confidence intervals (95%) > > Anybody can help me?
>-----Original Message----- >From: r-help-bounces at stat.math.ethz.ch >[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of David Nogu?s >Sent: Thursday, May 15, 2003 12:41 PM >To: R-help >Subject: [R] plot question > > >Hello: > >Im a novice user of R. I was triying develop graphs with plot.lm or >plot(gam) but I dont obtain a desire result. I would like to create a>plot from lm, glm and gam objects showing: > >1- Fit curve >2- Raw data of predictor and response variables as points. >3- Confidence intervals (95%) > >Anybody can help me? > >-- >David Nogu?s BravoHere is a link to a post of mine back in March which provides example code for plot.lm(): https://www.stat.math.ethz.ch/pipermail/r-help/2003-March/030057.html HTH, Marc Schwartz