Author / maintainer: Dr Merwan Roudane · merwanroudane920@gmail.com · Repo: https://github.com/merwanroudane/qqkrlsr
qqkrls implements Quantile-on-Quantile KRLS as in Adebayo et al.
(2024). For each quantile theta of the independent variable, the response
is fit by KRLS (Hainmueller and Hazlett 2014) on the corresponding
sub-sample. The tau-quantile of the resulting pointwise marginal effects
yields the QQKRLS coefficient beta(theta, tau). Standard errors come from
a paired bootstrap.
All 3D surfaces, heatmaps and contour plots default to MATLAB Parula.
# from CRAN (once accepted)
install.packages("qqkrls")
# development version
# install.packages("remotes")
remotes::install_github("merwanroudane/qqkrlsr")
# from a local source tarball
install.packages("qqkrls_1.0.0.tar.gz", repos = NULL, type = "source")
library(qqkrls)
set.seed(1)
n <- 200
x <- rnorm(n)
y <- 0.5 * sin(x) + rnorm(n, sd = 0.3)
fit <- qqkrls(y, x, n_boot = 100)
print(fit)
# 3D surface with MATLAB Parula
plot_qqkrls_3d(fit, value = "coefficient", colorscale = "Parula")
# Heatmap with significance stars
plot_qqkrls_heatmap(fit, value = "coefficient", show_stars = TRUE)
GPL-3