Learn R Programming

paneltests (version 1.0.5)

xtqsh: Quantile Regression Slope Homogeneity Test for Panel Data

Description

Tests the null hypothesis of slope homogeneity in panel quantile regressions. Implements the S-hat and D-hat statistics of Galvao et al. (2017).

Usage

xtqsh(formula, data, index, tau, bw = "hallsheather", marginal = FALSE)

Value

An object of class "xtqsh" containing test statistics and p-values.

Arguments

formula

A formula of the form y ~ x1 + x2 + ....

data

A data frame containing the panel data in long format.

index

Character vector of length 2: c("id_var", "time_var").

tau

Numeric vector of quantile levels, each strictly between 0 and 1.

bw

Bandwidth method: "hallsheather" (default) or "bofinger".

marginal

Logical. If TRUE, compute per-variable marginal tests. Default FALSE.

References

Galvao, A.F., Juhl, T., Montes-Rojas, G. and Olmo, J. (2017). Testing Slope Homogeneity in Quantile Regression Panel Data. Journal of Financial Econometrics, 16(2), 211-243.

Examples

Run this code
# \donttest{
set.seed(42)
n <- 10; tt <- 20
dat <- data.frame(
  id   = rep(1:n, each = tt),
  time = rep(1:tt, times = n),
  y    = rnorm(n * tt),
  x1   = rnorm(n * tt)
)
res <- xtqsh(y ~ x1, data = dat, index = c("id", "time"), tau = 0.5)
print(res)
# }

Run the code above in your browser using DataLab