Learn R Programming

qpcR (version 1.3-7.1)

neill.test: Neill's lack-of-fit test when replicates are lacking

Description

This is a test for nonlinear models in the absence of replicates. A grouping of the predictor values has to be provided. If missing, it is calculated from cutting the dendrogram into groups of at least 2 predictor values. See 'References' for details. Works on any model WITHOUT replicates of class 'pcrfit' or 'nls'.

Usage

neill.test(object, grouping)

Arguments

object
an object of class 'pcrfit'.
grouping
vector that provides the grouping of the predictor ('Cycles') values.

Value

  • The p-value from the test.

encoding

latin1

Details

Let the total number of observations be denoted by $\sum{n_i}$ and let $\bar{G}(\theta)$ be defined by $$\bar{G}(\theta) = (G(x_1, \theta)j_{n_{1}}', \ldots,G(x_M, \theta)j_{n_{M}}')'$$, where $j_{n_{i}}$ is an $n_i \times 1$ vector of ones, $i = 1,2, \ldots, M$. Also, $Y = (Y_{11}, \ldots, Y_{1n_{1}}, \ldots, Y_{Mn_{m}})'$ and $\bar{Y} = (\bar{Y}_{1 \cdot j_{n_{1}}'}, \ldots, \bar{Y}_{M \cdot j_{n_{M}}'})'$. To test $$H_0: E(Y) = \bar{G}(\theta)$$ vs. $$H_{\alpha}: E(Y) \neq \bar{G}(\theta)$$ let the statistic $F$ be defined by $$F = \frac{N - M}{M - p} \cdot \frac{\left(\parallel \bar{Y} - \bar{G}(\hat{\theta}) \parallel \right) ^2}{\left( \parallel Y - \bar{Y} \parallel \right) ^2}$$, where $\hat{\theta}$ is the least-squares parameter estimator of $\theta$. Reject $H_0$ if observed $F > F_{M-p, N-M}^\alpha$. This is a nonlinear analogue to the Lack-of-fit test in linear models with replication.

References

Testing for lack-of-fit in nonlinear regression. Neill JW. Ann Statist (1988), 16: 733-740. Lack-of-fit tests for assessing mean structures for continuous dose-response data. Ritz C & Martinussen T. Environ Ecol Stat (2011), 18: 349-366.

Examples

Run this code
## compare two models
m1 <- pcrfit(reps, 1, 2, l4)
m2 <- pcrfit(reps, 1, 2, l5)
neill.test(m1)
neill.test(m2)

## using example from 'nls'
## Fails when replicates are given
DNase1 <- subset(DNase, Run == 1)  
fm1DNase1 <- nls(density ~ SSlogis(log(conc), Asym, xmid, scal), DNase1)
neill.test(fm1DNase1)
## But works if replicates are removed
DNase2 <- DNase1[-c(2, 4, 6, 8, 10, 12, 14, 16),]
fm1DNase2 <- nls(density ~ SSlogis(log(conc), Asym, xmid, scal), DNase2)
neill.test(fm1DNase2)

Run the code above in your browser using DataLab