I think now everything should be fine and the problem should disappear.
And now about my problem. 'x' is not a set of residuals from an ARMA fit.
I just have 982 weekly quotations of a given stock index and I want to run a
Ljung-Box test on these data to test for autocorrelation. So 'x' would be
exactly this time series of 982 quotations. I need the results of the
Ljung-Box test for the table of descriptive statistics in which I also have
mean, st. deviation, skewness, kurtosis and Jarque-Bera. The only problem is
that I do not know what should be the value of 'lag' in the formula
Box.test.
I found an article where authors have daily quotations and they apply
Ljung-Box Q-test statistics with up to 10-day lags ( LB(10) ). They do it
for 1213 observations as well as for 671 and 542 observations. I do not
understand why did they choose 10-day lags..

I hope now everything is clear...

Regards
Marcin




2011/8/27 Prof Brian Ripley <ripley@stats.ox.ac.uk>

> Please fix your email settings: your 'From:' field is not in the correct
> encoding, so I had to manually copy the ASCII part. (The header as received
> here said it was UTF-8, but it is not valid UTF-8. Most likely no encoding
> was declared your end.)
>
>
> On Sat, 27 Aug 2011, Marcin P????ciennik wrote:
>
>  Dear list members,
>>
>> I have 982 quotations of a given stock index and I want to run a Ljung-Box
>> test on these data to test for autocorrelation. Later on I will estimate 8
>> coefficients.
>> I do not know how many degrees of freedom should I assume in the formula
>> for
>> Ljung-Box test. Could anyone tell me please?
>>
>
> Nor does anyone else without knowing what 'x' is.  But from the help page:
>
>   fitdf: number of degrees of freedom to be subtracted if ‘x’ is a
>          series of residuals.
>
> Details:
>
>     These tests are sometimes applied to the residuals from an
>     ‘ARMA(p, q)’ fit, in which case the references suggest a better
>     approximation to the null-hypothesis distribution is obtained by
>     setting ‘fitdf = p+q’, provided of course that ‘lag > fitdf’.
>
> So is 'x' a set of residuals from an ARMA fit?  If so, the help page told
> you how, and if it is a not a fit note the word 'if' in the description of
> 'fitdf'.
>
>  Below the formula:
>>
>> Box.test(x, lag = ????, type = c("Ljung-Box"), fitdf = 0)
>>
>>
>> Thank you very much in advance.
>> Best regards
>> Marcin
>>
>>        [[alternative HTML version deleted]]
>>
>
> Please don't send HTML as you were explicitly asked in the posting guide.
> Very likely that exacerbated the encoding confusion.
>
>  PLEASE do read the posting guide http://www.R-project.org/**
>> posting-guide.html <http://www.R-project.org/posting-guide.html>
>>
>
> --
> Brian D. Ripley,                  ripley@stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~**ripley/<http://www.stats.ox.ac.uk/%7Eripley/>
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595

	[[alternative HTML version deleted]]

