[R] Vector autoregression, panel data

From: TomBom <taarnio_at_paju.oulu.fi>
Date: Tue, 25 Nov 2008 03:06:28 -0800 (PST)

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.

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 25 Nov 2008 - 12:49:06 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 25 Nov 2008 - 13:30:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive