[R] please help me
bolker at ufl.edu
Sat Oct 20 14:18:50 CEST 2007
azadeh sadeghian wrote:
> dear list
> I am student M.S. statistics in department statistics . I am working in
> the function "nls" in the [R 2.3.1] with 246 data and want to fit a model
> to vectors( v and u ) but I have
> a problem to use it
Thanks for providing a reproducible example. Your version of R is
you should probably update (or ask you administrator to update) to make sure
that all possible bugs etc. are fixed.
## always a good idea to look at the data
## your code: error
## you need a * between ".5" and "(a^2)"
m2 = nls(v~c0+.5*(a^2)*(u^2),start=list(c0=0,a=.3))
## you can also fit this (quadratic regression) with lm
m3 = lm(v~I(u^2))
## converting the coefficient
## you need to use sensible starting conditions!
## one way to get is to look at the plot and
## take a guess. Another would be to assume
## c0=0 and fit a linear model to log(v) as a function
## of log(u)
View this message in context: http://www.nabble.com/please-help-me-tf4657131.html#a13309307
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help