R2nls: Goodness of fit for nonlinear regression

View source: R/R2.nls.R

R2nlsR Documentation

Goodness of fit for nonlinear regression

Description

This function calculates measures of goodness of fit for nonlinear regression. It works with both 'nls' and 'drc' objects

Usage

R2nls(object)

Arguments

object

A nonlinear regression fit object. It can be either a 'nls' fit or 'drm' fit.

Value

A list with the following slots:

R2

Traditional coefficient of determination, calculated as the ratio of model SS to total SS. Formula as in Schabenberger and Pierce, 5.23, pag 211.

PseudoR2

Pseudo-R2, more useful for nonlinear regression with no-intercept-models. Formula Formula as in Schabenberger and Pierce, 5.24, pag 212.

R2adj

Adjusted R2, similar to R2 above, but penalised for higher number of parameters.

MSE

Mean Squared Error

RMSE

Root Means Squared Error

RRMSE

Relative Root Means Squared Error

Author(s)

Andrea Onofri

References

Schabenberger, O., Pierce, F.J., 2002. Contemporary statistical models for the plant and soil sciences. Taylor & Francis, CRC Press, Books.

Examples

data(beetGrowth)
mod3 <- nls(weightInf ~ NLS.L3(DAE, b, c, d), data = beetGrowth)
R2nls(mod3)

mod4 <- drm(weightInf ~ DAE, fct = L.3(), data = beetGrowth)
R2nls(mod4)

OnofriAndreaPG/aomisc documentation built on Feb. 26, 2024, 8:21 p.m.