[R] an incredibly trivial question about nls

Peter Langfelder peter.langfelder at gmail.com
Tue Jul 1 22:48:49 CEST 2014


On Tue, Jul 1, 2014 at 1:27 PM, Erin Hodgess <erinm.hodgess at gmail.com> wrote:
> Hello R People:
>
> I'm having a forest/trees location problem with the output of nls.
>
> If I save the output to an object, and print the object, it shows, amongst
> other things, the residual sum of squares.  I would like to get that.
>
> However, when I look at names or str of the object, I can't find the
> residual sum of squares.

I think you want to look at summary(object), which contains (see
help("summary.nls"))

   sigma: the square root of the estimated variance of the random error

                          sigma^2 = 1/(n-p) Sum(R[i]^2),

          where R[i] is the i-th weighted residual.

In other words, you probably want summary(object)$sigma^2*(n-p),
perhaps a square root of it, or maybe just the sigma.

HTH,

Peter



More information about the R-help mailing list