harvtest  R Documentation 
HarveyCollier test for linearity.
harvtest(formula, order.by = NULL, data = list())
formula 
a symbolic description for the model to be tested
(or a fitted 
order.by 
Either a vector 
data 
an optional data frame containing the variables in the model.
By default the variables are taken from the environment which

The HarveyCollier test performs a ttest (with parameter
degrees of
freedom) on the recursive residuals. If the true relationship is not linear but
convex or concave the mean of the recursive residuals should differ
from 0 significantly.
Examples can not only be found on this page, but also on the help pages of the
data sets bondyield
, currencysubstitution
,
growthofmoney
, moneydemand
,
unemployment
,
wages
.
A list with class "htest"
containing the following components:
statistic 
the value of the test statistic. 
p.value 
the pvalue of the test. 
parameter 
degrees of freedom. 
method 
a character string indicating what type of test was performed. 
data.name 
a character string giving the name(s) of the data. 
A. Harvey & P. Collier (1977), Testing for Functional Misspecification in Regression Analysis. Journal of Econometrics 6, 103–119
W. Krämer & H. Sonnberger (1986), The Linear Regression Model under Test. Heidelberg: Physica
lm
# generate a regressor and dependent variable x < 1:50 y1 < 1 + x + rnorm(50) y2 < y1 + 0.3*x^2 ## perform HarveyCollier test harv < harvtest(y1 ~ x) harv ## calculate critical value vor 0.05 level qt(0.95, harv$parameter) harvtest(y2 ~ x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.