0

I want to perform Variance Ratio tests (Lo-MackKinlay, Chow-Denning) but I have some problem with the running of the commands.

  1. I have a price Index for 1957 to 2007. Do I need to perform the variance ratio tests on the level series or on the series of returns?

  2. How do you fix the kvec? It is a vector with the lags for which you want to do the test right?

So here is my output:

> rcorr
 [1]  0.0000 -0.1077  0.4103 -0.0347  0.1136  0.0286  0.0104  0.0104  0.1915
[10] -0.0025  0.0665  0.2127  0.0116 -0.1288  0.1640  0.3089  0.2098 -0.1071
[19] -0.2079 -0.1082  0.0022  0.1419  0.0641 -0.0082 -0.1163 -0.1731  0.0260
[28]  0.0468  0.0882  0.2640  0.3946  0.2094  0.2754  0.0623 -0.3696 -0.1095
[37] -0.1463  0.0118  0.0152 -0.0103  0.0223  0.0379  0.0580 -0.0091 -0.0510
[46]  0.0765  0.0984  0.1250  0.0519  0.1623  0.2552
> kvec<--c(2,5,10)
> Lo.Mac(rcorr,kvec)
Error in y[index] : only 0's may be mixed with negative subscripts

Why do I get this error?

Mat
  • 202,337
  • 40
  • 393
  • 406
Geraldine
  • 47
  • 2

1 Answers1

1

It is the same error as in your other question I just answered:

kvec<--c(2,5,10)

is the same as

kvec <- -c(2,5,10)

ie

kvec <- -1 * c(2,5,10)

Remove the second dash.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • Thank you very much for your answers. Do you know where R stores the pvalue of the test, the critical value it compares the test stat with? Is it possible to get an answer from R that details every bit of the test for this package? – Geraldine Jan 06 '13 at 17:21
  • Welcome to StackOverflow. It is common to 'accept' answers deemed suitable, can do that by clicking on the 'tick mark' you (as the person having asked the question) see. As for the p-value: often on the object returned from a test function. Call `str()` on it to see. – Dirk Eddelbuettel Jan 06 '13 at 18:19
  • Thank you for the advice and for your wise answers. It did not really work so I will ask an other question in an other topic. – Geraldine Jan 06 '13 at 20:39