See the nls help page:
Arguments
formula a nonlinear model formula including variables and parameters.
and you have
y ~ 1/(1+x)
which does not seem to match the requirement of the help page.
What are the unknowns for which you were hoping nls would solve??
On Sat, 23 Dec 2006, ivo welch wrote:
> dear R experts: I am trying to orient myself using nls(). so, I am
> just trying to copy and adapt an example in the nls() function:
>
> > d= data.frame( y= runif(10), x= runif(10) )
> > nls( y ~ 1/(1+x), data = d, start= list(x=0.5,y=0.5), trace=TRUE)
> Error in n%%respLength : non-numeric argument to binary operator
>
> the error message seems internal, so it would be nicer if there was a
> better error message. I presume my mistake is so basic that an R
> expert sees the problem in 1 second.
>
> (if I manage to figure this one out, my next step will be to learn how
> I can get [presumably asymptotic ML] standard errors on estimated
> coefficients.
Look at the help page for nls. Specifically under 'Details'.
I hope I am looking in the right direction with the> nls() function.)
>
> advice appreciated.
>
> regards,
>
> /ivo
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>
Charles C. Berry (858) 534-2098
Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu UC San Diego
http://biostat.ucsd.edu/~cberry/ La Jolla, San Diego 92093-0717