[R] fitting non linear data

Ko-Kang Kevin Wang Ko-Kang at xtra.co.nz
Wed May 22 12:53:02 CEST 2002


Hi,

----- Original Message -----
From: "gregory lefebvre" <greggory.lefebvre at univ-rouen.fr>
To: <r-help at stat.math.ethz.ch>
Sent: Wednesday, May 22, 2002 10:21 PM
Subject: [R] fitting non linear data


> Hye every one,
>
> My question will certainly seem stupid as I am quite a beginner in R.

There are no stupid questions...:-)

> I would like to trace a curve which fits these two vectors:
>  x<-c( 2,3,4,5,6,7,8,10 )
>  y<-c( 20, 12, 8, 6, 5, 4.5, 4, 3.8)
>
> It seems to follow a non linear model.
>
> Could anyone help me because I could'nt find the answer I am looking for
> in the FAQs.

Take a look at:
  library(help=MASS)
  library(help=nls)

In particular, the nls (non-linear regression) package.

The MASS book (Modern Applied Statistics with Splus) by Ripley and Venables
is a very good book to start.  In Chapter 8 (of the 3rd Edition), there are
quite an extensive explanations of how you can do non-linear models in
R/Splus.

MASS and nls packages are installed with R, you can open
$R_HOME/library/MASS/scripts3/ch08.R to look at ALL the R codes for that
chapter on non-linear models.

Cheers,

Ko-Kang Wang
------------------------------------------------
Ko-Kang Kevin Wang
Post Graduate PGDipSci Student
Department of Statistics
University of Auckland
New Zealand
www.stat.auckand.ac.nz/~kwan022


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list