xtpcmg: Panel Cointegrating Polynomial Regressions via FM-OLS

View source: R/xtpcmg.R

xtpcmgR Documentation

Panel Cointegrating Polynomial Regressions via FM-OLS

Description

Estimates a polynomial cointegrating regression in a panel using either Group-Mean FM-OLS (Wagner & Reichold 2023) or Pooled FM-OLS (de Jong & Wagner 2022). Models the long-run relationship:

Usage

xtpcmg(
  data,
  y,
  x,
  panel_id,
  time_id,
  model = c("mg", "pmg"),
  q = 2L,
  controls = NULL,
  trend = 1L,
  kernel = "ba",
  bw = "And91",
  effects = "oneway",
  corr_rob = FALSE
)

Arguments

data

A data frame in long format.

y

Character. Name of the dependent variable.

x

Character. Name of the polynomial (I(1)) regressor.

panel_id

Character. Name of the panel identifier variable.

time_id

Character. Name of the time variable.

model

Character. Estimator: "mg" for Group-Mean FM-OLS (default) or "pmg" for Pooled FM-OLS.

q

Integer. Polynomial degree: 2 (quadratic, default) or 3 (cubic).

controls

Character vector. Names of additional I(1) control variables. Default is NULL (no controls).

trend

Integer. Deterministic trend type: 1 for demeaning only (default), 2 for demeaning and detrending.

kernel

Character. HAC kernel: "ba" (Bartlett, default), "pa" (Parzen), "qs" (Quadratic Spectral), "tr" (truncated), "bo" (Bohman).

bw

Character or numeric. Bandwidth for HAC estimation. "And91" (default) uses Andrews (1991) automatic selection. A numeric value sets the bandwidth directly.

effects

Character. For Pooled FM-OLS: "oneway" (default) for one-way demeaning or "twoways" for two-way demeaning.

corr_rob

Logical. For Group-Mean FM-OLS: if TRUE, use cross-sectionally robust VCV. Default is FALSE.

Details

y_{it} = \alpha_i + \beta_1 x_{it} + \beta_2 x_{it}^2 [+ \beta_3 x_{it}^3] [+ \gamma z_{it}] + u_{it}

where x_{it} and z_{it} are I(1) processes.

Value

An object of class "xtpcmg" with elements: coefficients (named numeric vector), vcov (variance-covariance matrix), se (standard errors), tstat (t-statistics), pvalue (two-sided p-values), model (estimator type: mg or pmg), q (polynomial degree), N (number of panel units), TT (number of time periods), y (dependent variable name), x (polynomial variable name), tp (turning point estimate, quadratic models only), tp_se (delta-method SE for turning point), tp_lo and tp_hi (95% CI bounds), ind_coef (individual FM-OLS estimates, MG model), swamy_s and swamy_p (Swamy slope homogeneity test).

References

Andrews, D.W.K. (1991). Heteroskedasticity and autocorrelation consistent covariance matrix estimation. Econometrica, 59(3), 817–858. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2307/2938229")}

de Jong, R.M. and Wagner, M. (2022). Panel cointegrating polynomial regressions. Annals of Applied Statistics, 16(1), 416–442. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/21-AOAS1536")}

Wagner, M. and Reichold, K. (2023). Panel cointegrating polynomial regressions. Econometric Reviews, 42(9–10), 782–827. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/07474938.2023.2178141")}

Examples

dat <- grunfeld_cmg()

# Group-Mean FM-OLS (quadratic EKC-type model)
res <- xtpcmg(dat, y = "invest", x = "mvalue",
              panel_id = "firm", time_id = "year",
              model = "mg", q = 2L)
print(res)
summary(res)

# Pooled FM-OLS
res2 <- xtpcmg(dat, y = "invest", x = "mvalue",
               panel_id = "firm", time_id = "year",
               model = "pmg", q = 2L)
print(res2)


caustests documentation built on April 5, 2026, 9:06 a.m.