3
$\begingroup$

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.

$\endgroup$
0

2 Answers 2

8
$\begingroup$

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.

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

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
        ) 
      )
$\endgroup$
1
  • $\begingroup$ I don't think that's exactly PVAR, but it is an interesting approach to dealing with the same problem, so: thank you. $\endgroup$
    – ulfelder
    Commented Sep 28, 2016 at 17:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.