Learn R Programming

onls (version 0.3)

anova.onls: Comparison of nested orthogonal regression models

Description

Compares nested models fitted by onls to the same data with the same measurement errors, by the change in the minimized orthogonal objective \(S\): an F test when the error variances are estimated, a likelihood-ratio chi-square test when they are known.

Usage

# S3 method for onls
anova(object, ...)

Value

An object of class "anova" (a data frame) with one row per model: the residual degrees of freedom (Res.Df), the orthogonal objective \(S\) (Res.Obj), the change in degrees of freedom (Df) and in the objective (Obj) from the preceding model, and the test statistic with its p-value (F value, Pr(>F) or Chisq, Pr(>Chi)).

Arguments

object

an object returned from onls.

...

further onls fits to be compared with object, in order of increasing (or decreasing) complexity.

Author

Andrej-Nikolai Spiess

Details

onls estimates the parameters by minimizing the weighted sum of squared orthogonal distances $$S = \sum_{i=1}^{n} d_i^2 = \sum_{i=1}^{n} \left[ Qyy_i \left(y_i - f(\hat\xi_i, \hat\theta)\right)^2 + (\hat\xi_i - x_i)^T Qx_i (\hat\xi_i - x_i) \right]$$ (objective of the fit, see onls). The comparison of nested models is based on this criterion. As in anova.nls, each model is compared with the preceding one in the list. For a model \(a\) with \(df_a\) residual degrees of freedom and a model \(b\) with more parameters (\(df_b < df_a\)):

Estimated variances (known_sigma = FALSE): the extra-sum-of-squares F test $$F = \frac{(S_a - S_b)/(df_a - df_b)}{S_b/df_b} \sim F_{df_a - df_b,\; df_b}$$

Known variances (known_sigma = TRUE): with the errors on their absolute scale, \(S\) is \(-2\) times the log-likelihood of the errors-in-variables model up to a constant (see logLik_o), so that \(S_a - S_b\) is the likelihood-ratio statistic, referred to a \(\chi^2\) distribution with \(df_a - df_b\) degrees of freedom. The models must have been fitted to the same observations, with the same weights, sigma_y and sigma_x for the predictors they share, and with the same known_sigma.

See Also

onls, logLik_o for AIC/BIC of non-nested models, profile.onls and confint.onls, which use the same criterion for single parameters.

Examples

Run this code
## Enzyme kinetics with errors in the substrate concentration (pipetting, 8%)
## and in the rate: Michaelis-Menten (h = 1) or cooperative Hill kinetics?
set.seed(42)
S_true <- rep(c(0.25, 0.5, 1, 2, 4, 8, 16, 32), each = 3)
ENZ <- data.frame(S = S_true * exp(rnorm(24, 0, 0.08)),
                  v = 10 * S_true^1.5 / (3^1.5 + S_true^1.5) + rnorm(24, 0, 0.25))

mm    <- onls(v ~ Vm * S / (K + S), data = ENZ, start = list(Vm = 10, K = 3))
hill  <- onls(v ~ Vm * S^h / (K^h + S^h), data = ENZ,
              start = list(Vm = 10, K = 3, h = 1))
hill0 <- onls(v ~ v0 + Vm * S^h / (K^h + S^h), data = ENZ,
              start = list(v0 = 0, Vm = 10, K = 3, h = 1.5))

## Sequential F tests on the orthogonal objective (variances estimated):
## the Hill exponent is needed, a baseline rate is not
anova(mm, hill, hill0)

Run the code above in your browser using DataLab