Learn R Programming

lmtest (version 0.2-2)

harvtest: Harvey-Collier-Test

Description

harvtest performs the Harvey-Collier-Test for linearity.

Usage

harvtest(formula, data=list())

Arguments

formula
a symbolic describtion for the model to be tested
data
an optional data frame containing the variables in the model. By default the variables are taken from the environment which 'harvtest' is called from

Value

  • A list with class "htest" containing the following components:
  • statisticthe value of the test statistic.
  • p.valuethe p-value of the test.
  • methoda character string indicating what type of test was performed.
  • data.namea character string giving the name(s) of the data.

Details

The Harvey-Collier-Tests examines if the true relationship is linear versus a convex or concave relationship under the alternative. The test statistic under null hypothesis follows a t distribution with df degree of freedom.

References

Kraemer, W., Sonnberger, H. (1986): The linear regression model under test

See Also

lm

Examples

Run this code
x <- c(1:30)
y <- x^2 + rnorm(30,0,2)
formular <- y ~ x
harv <- harvtest(formular)
qt(0.95, harv$parameter[1])

Run the code above in your browser using DataLab