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. Any help would be much appreciated. thanks, Erin -- Erin Hodgess Associate Professor Department of Mathematical and Statistics University of Houston - Downtown mailto: erinm.hodgess@gmail.com [[alternative HTML version deleted]]
1. Why? What do you think it tells you? (The number of parameters in a NONlinear model is probably not what you think it is). 2. ?deviance 3. You've been posting all this time and still didn't try stats:::print.nls ?? -- which is where you would find the answer. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." Clifford Stoll 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. > > Any help would be much appreciated. > thanks, > Erin > > > -- > Erin Hodgess > Associate Professor > Department of Mathematical and Statistics > University of Houston - Downtown > mailto: erinm.hodgess at gmail.com > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org 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.
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