Re: [R] Plotting a Quadratic...

From: Jorge Ivan Velez <jorgeivanvelez_at_gmail.com>
Date: Thu, 22 May 2008 14:12:44 -0400

Hi Ryan,
See the example in ?predict.lm . I think it would be useful in this case.

HTH, Jorge

On Wed, Dec 31, 1969 at 8:16 PM, Ryan Harrigan <iluvsa_at_ucla.edu> wrote:

> I have an equation describing the best-fit model for a set of points (just
> 2
> axes) that is in the form:
>
> y=b+mx+px^2
>
> Where b is the intercept, m is the slope describing a linear term, and p is
> a slope of the quadratic term.
>
> I would like to plot this equation on a curve (I know the equation is
> y=(.1766x^2)+(.171x)+.101) on the original scatterplot. Any easy way to
> plot
> this equation and preferably with a prediction interval around the line?
>
> I have tried the lines() and predict() commands, using the linear model to
> plot, but get very whacky results. abline works great but does not include
> the quadratic term.
>
> Any help you could provide would be much appreciated,
>
> Ryan Harigan
>
>
> --
> Ryan Harrigan, Ph.D.
> Center for Tropical Research
> Institute of the Environment
> La Kretz Hall, Suite 300
> Box 951496
> Los Angeles, CA 90095-1496
> 203-804-9505
> iluvsa_at_ucla.edu
>
> ______________________________________________
> R-help_at_r-project.org 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.
>

        [[alternative HTML version deleted]]



R-help_at_r-project.org 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. Received on Thu 22 May 2008 - 18:18:56 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 22 May 2008 - 18:30:39 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive