Skip to content
Back to formatted view

Raw Message

Message-ID: <11954C8B-30AE-477D-9BF9-3E103E4912DA@comcast.net>
Date: 2009-03-04T18:49:28Z
From: David Winsemius
Subject: best fit line
In-Reply-To: <22336095.post@talk.nabble.com>

On Mar 4, 2009, at 1:22 PM, anujgoel wrote:

>
> Dear R Community,
> I am plotting this simple x-y plot (raw data & plot attached).
> I cant fit a linear regression line to it. I have to figure out what  
> is the
> best fit for this graph.

That is virtually impossible to define rigorously. The "best fit"  
would go through all the points precisely, the extreme form of  
overfitting, but the mathematical result would not be informative at  
all. Where did these data come from? What domain of science are you  
working on? You want a result that incorporates the relationships  
known to exist in your domain of investigation and summarizes the data  
without overfitting. I am being intentionally vague in what follows  
because this looks like homework.

> Is there a way to tell which regression to use for
> this kind of data?

Not really. Looks rather "hyperbolic", so you might think about the  
formula for hyperbola and then use the lm function.

>
> Also, after selecting the best fit model, I need to extrapolate what  
> could
> be the other possible data points.

The predict functions are used for this purpose. Consult you  
documentation.
?predict

-- 
David Winsemius

>
> I am new to R. Could anyone please help?
> Thanks.
> Anuj
> http://www.nabble.com/file/p22336095/plot.jpg
> -- 
> View this message in context: http://www.nabble.com/best-fit-line-tp22336095p22336095.html
> Sent from the R help mailing list archive at Nabble.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.