[R] Vector autoregression, panel data

TomBom taarnio at paju.oulu.fi
Tue Nov 25 12:06:28 CET 2008


Hi! I'm a new R user and I have a question about estimating VAR on a panel
data. What I'm trying to do is to explain stock's volume on it's lagged
volume, it's lagged returns and lagged market return's (and vice versa). In
addition I have generated an exogenous variable controlling for stock's
volatility. Some of you may be familiar with this experiment since it
follows Statman, Thorley & Vorkink (2004) article.

The problem is how to estimate VAR by a stock when using panel data?
Previously I have been using SAS which easily allows to estimate VAR by
variable. In this case, the SAS code is: 

proc varmax data= xxx; 
      model VOLUME RETURN MARKETRET = VOLATILITY / p=3 ; 
	  by STOCK;

So how to do the same thing with R?

Here is a sample of my data:

STOCK DATE        RETURN          MARKETRET      VOLUME        VOLATILITY
ALBAV 19910228  0.0000000000  1.082824e-02  1.003302e-01 3.054257e-04
ALBAV 19910327 -0.0165264410 -3.946030e-04 -2.650549e-01 3.046369e-04
ALBAV 19910430  0.0000000000  2.041973e-03 -2.682568e-01 3.038513e-04
ALBAV 19910531  0.0000000000  6.682507e-03  1.905265e-02 3.030691e-04
FUM1V 19910228  ...                  ... 
FUM1V 19910327  ...                  ...
FUM1V 19910430  ...                  ...
NOK1V 19910228
NOK1V 19910327
NOK1V 19910430

Hope someone can help.
-Tom
-- 
View this message in context: http://www.nabble.com/Vector-autoregression%2C-panel-data-tp20679144p20679144.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list