Panel vector autoregression models in R? [duplicate]

Are there any R packages that can estimate panel vector autoregression (panel VAR, or PVAR) models from pooled time-series data?

I've searched several ways and come up empty. I'm hoping I've overlooked something that you know where to find.

If you're wondering what panel VAR models are and how they might be useful, this paper is not a bad place to start.

2 Answers

There is your solution. Code will be available soon.

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2896087

Panel Vector Autoregression in R: The Panelvar Package:

This paper considers two types of generalized method of moments (GMM) estimators for panel vector autoregression models (PVAR) with fixed individual effects. First, the first difference GMM estimator is implemented. It is an extension of the single equation dynamic panel model. A GMM-estimator for single equation dynamic panel model is implemented in the STATA package xtabond2. Some of the xtabond2 features are covered in the R package: plm. Second, also the so-called system GMM estimator is extended from single equation dynamic panel models to PVAR models. In addition to the GMM-estimators we contribute to the literature by providing specification tests (Hansen overidentification test, lag selection criterion and stability test of the PVAR polynomial) and classical structural analysis for PVAR models such as orthogonal and generalized impulse response functions, bootstrapped confidence intervals for impulse response analysis and forecast error variance decompositions. Finally, we implement the first difference and the forward orthogonal transformation to remove the fixed effects.

• Welcome to Crossvalidated. Please add more information. Maybe you could summarise the paper. A link is not sufficient. Jan 17, 2017 at 8:55
• Is there a development version/repository for the panelvar package somewhere? Mar 21, 2017 at 7:37
• Any update on this? Jul 8, 2017 at 11:04
• I was in contact with the authors and apparently they are waiting to publish their code until the paper was accepted by a journal. Sep 13, 2017 at 7:57
• researchgate.net/publication/322526372_panelvar_044 you will find the package here. Good luck with your research! Jan 20, 2018 at 20:14

Christoph Adolph makes it possible: For panels with long T:

      # Load libraries
library(nlme)      # Estimation of mixed effects models
library(lme4)      # Alternative package for mixed effects models
library(plm)       # Econometrics package for linear panel models
library(arm)       # Gelman & Hill code for mixed effects simulation
library(pcse)      # Calculate PCSEs for LS models (Beck & Katz)
library(tseries)   # For ADF unit root test
library(simcf)     # For panel functions and simulators
# Estimate a random effects AR(I)MA(p,q) model using lme (Restricted ML)
lme.res1 <- lme(# A formula object including the response,
# the fixed covariates, and any grouping variables
fixed = GDPWdiff ~ OIL + REG + EDT,

# The random effects component
random = ~ 1 | COUNTRY,

# The TS dynamics: specify the time & group variables,
# and the order of the ARMA(p,q) process
correlation = corARMA(form = ~ YEAR | COUNTRY,
p = 1,  # AR(p) order
q = 0   # MA(q) order
)
)

• I don't think that's exactly PVAR, but it is an interesting approach to dealing with the same problem, so: thank you. Sep 28, 2016 at 17:42