Some workers consider it bad practise to compute what is called R-squared for a nonlinear model. I find it useful for nonlinear models as a signpost of how good a fit has been found. But just as signposts can be turned around by vandals, nonlinear models can give a misleading indication. With linear models, sum((y - model(y))^2) must be smaller than sum((y - mean(y))^2). That is not necessary for nonlinear models. Also for linear models there are many equivalent formulas due to the many identities that go with the linear algebra. Those are not in force for nonlinear models. So what in linear models is "R-squared" is just a comparison to the model that is the mean of the predicted variable, i.e., the best single number model.
JN On 15-09-30 04:09 AM, peter dalgaard wrote: > >> On 30 Sep 2015, at 02:08 , Michael Eisenring <michael.eisenr...@gmx.ch> >> wrote: >> >> Can anyone tell me how to calculate the Total Corrected SS in R and how it >> can be implemented in my code? > > It is just sum((y-mean(y))^2). > > Beware that a fair amount of (somewhat silly) contention is going on in this > area, though. In particular, the formula can give negative values, which is > unfortunate if you try calling it "R^2". > > -pd > ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.