[R] Degrees of freedom using Box.test()

Nestor Arguea narguea at uwf.edu
Wed Mar 8 07:36:27 CET 2006


After an RSiteSeach("Box.test") I found some discussion regarding the degrees 
of freedom in the computation of the Ljung-Box test using Box.test(), but did 
not find any posting about the proper degrees of freedom.  

Box.test() uses "lag=number" as the degrees of freedom.  However, I believe  
the correct degrees of freedom should be "number-p-q" where p and q are the 
number of estimated parameters (for instance, in a Box-Jenkins family of 
models). This, according to the main source in documentation of Box.test:

G. M. Ljung and G. E. P. Box, On a measure of Lack of Fit in Time Series 
Models, Biometrika, Vol. 65, No. 2 (August, 1978), pp. 297-303.

One can still compute the correct p-value with

>1-pchisq(value,correctdf)


Nestor
(R 2.2.1 on Linux, Suse 9.3)

-- 
Nestor M. Arguea, Chair
Department of Marketing and Economics
University of West Florida
11000 University Parkway
Pensacola, FL 32514
Phone: (850)474-3071
Fax: (850)474-3069




More information about the R-help mailing list