fitting non-liner curves

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

fitting non-liner curves

Rangesh Kunnavakkam
Dear Sir/Madam,
                       I have two vectors say x<-c(0,0,2.73,3.42,3.95,4.26)
and y<-c(0.0,0.5,1.20,1.90,2.6,3.3). I want to fit y as a function of x and
get the equation.Do I have to use glm() ?
Rangesh

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: fitting non-liner curves

Uwe Ligges
Rangesh Kunnavakkam wrote:

> Dear Sir/Madam,
>                        I have two vectors say x<-c(0,0,2.73,3.42,3.95,4.26)
> and y<-c(0.0,0.5,1.20,1.90,2.6,3.3). I want to fit y as a function of x and
> get the equation.Do I have to use glm() ?

Depends on which underlying model you assume.

Uwe Ligges



> Rangesh
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: fitting non-liner curves

Gabor Grothendieck
In reply to this post by Rangesh Kunnavakkam
Just eyeballing your data it looks like a simple quadratic might be ok.

plot(y ~ x)
y.lm <- lm(y ~ poly(x, 2))
points(fitted(y.lm) ~ x, type = "b", col = 2)

On 2/16/06, Rangesh Kunnavakkam <[hidden email]> wrote:

> Dear Sir/Madam,
>                       I have two vectors say x<-c(0,0,2.73,3.42,3.95,4.26)
> and y<-c(0.0,0.5,1.20,1.90,2.6,3.3). I want to fit y as a function of x and
> get the equation.Do I have to use glm() ?
> Rangesh
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html