Skip to content
Back to formatted view

Raw Message

Message-ID: <2BE60296-7BAA-4EE6-BBD7-EC8C1D2CEF50@gmail.com>
Date: 2011-10-28T17:10:15Z
From: michael.weylandt at gmail.com (R. Michael Weylandt
Subject: Polynomial regression line
In-Reply-To: <49013713-CA39-4BC3-B2ED-B0C02C901E5F@bigelow.org>

I would think you could also do so with lines() directly, though you'll have to choose an appropriate mesh of points to do so. A little wrapper function could be written to do so pretty easily if you want to combine it with the scatterplot, but since the fitted values are already in the output of lm something like this should work:

# Untested
lines(m$x, m$fitted.values)

Michael

On Oct 28, 2011, at 12:10 PM, Ben Tupper <btupper at bigelow.org> wrote:

> Hi,
> 
> On Oct 28, 2011, at 11:49 AM, Fernando Andreacci wrote:
> 
>> The cubic regression of my model is significant and I want to plot a line
>> that best fits. It's not abline() function, because it has a curve. Please,
>> how can I plot it?
>> 
> 
> Will curve() do it for you?
> 
> ?curve
> 
> Cheers,
> Ben
> 
> 
> 
> 
>> 
>> 
>> ---
>> Fernando Andreacci
>> Bi?logo
>> Fone +55 47 9921 4015
>> fandreacci at gmail.com
>> 
>>    [[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.
> 
> Ben Tupper
> Bigelow Laboratory for Ocean Sciences
> 180 McKown Point Rd. P.O. Box 475
> West Boothbay Harbor, Maine   04575-0475 
> http://www.bigelow.org
> 
> ______________________________________________
> 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.