Simulation code and data for: Variance-Covariance Matrix Estimation for the Biresponse Truncated Spline Quantile Regression Model
Description
This dataset contains the R code and simulation output supporting the MethodsX article "Variance-Covariance Matrix Estimation for the Biresponse Truncated Spline Quantile Regression Model" (Irwan, A. Islamiyati, S. Toaha). The script implements the block sandwich estimator Var(beta_hat) = A^{-1} B A^{-1} for the biresponse truncated spline quantile regression model, including (i) the Gaussian kernel estimator of f_r(0) with Silverman's bandwidth (Eq. 12), (ii) the estimator of the score covariance sigma_12 (Eq. 13), and (iii) Wald intervals for the spline coefficients and for the cross-response contrasts beta_1j - beta_2j. The Monte Carlo study uses dependent skew-normal errors generated through a Gaussian copula (rho = 0, 0.5, 0.8), linear truncated splines with knots {0.3, 0.5, 0.7}, sample sizes n = 50, 100, 200, quantile levels tau = 0.25, 0.50, 0.75 and M = 1000 replications. Three methods are compared: the proposed estimator, a naive version with sigma_12 = 0, and the pairs bootstrap (1000 resamples, percentile intervals). A bandwidth sensitivity analysis (Hall-Sheather and Bofinger) is also included. Files: - simulasi_komprehensif_revisi.R : complete simulation code - Table1_manuscript.csv : coverage, mean width and SE/SD (Table 1) - Table2_manuscript.csv : validation of sigma_12 and coverage of contrasts (Table 2) - TableS1_bandwidth.csv : bandwidth sensitivity (Supplementary Table S1) - FigureB2_IntervalWidth_Boxplot.png : Fig. 1 of the article Section 1 of the script (check-loss comparison between models) is exploratory and is not reported in the article.
Files
Steps to reproduce
Step to reproduce 1. Install R (version 4.3 or later) and the packages: install.packages(c("quantreg", "sn", "MASS", "mvtnorm", "ggplot2", "scales", "patchwork", "dplyr")) 2. Place simulasi_komprehensif_revisi.R in a working folder and set it as the working directory in R. 3. Optional quick check (about 1 minute): set QUICK_TEST <- TRUE at the top of the script. 4. Full run: keep QUICK_TEST <- FALSE and run source("simulasi_komprehensif_revisi.R"). The script runs the 27 scenarios in parallel on all available cores minus one (N_CORES); progress is written to progress_simulasi.txt. Run time is about 5 hours on a single core and roughly 1-2 hours on 4-8 cores. 5. The script writes Table1_manuscript.csv, Table2_manuscript.csv, TableS1_bandwidth.csv and the figures to the working directory, and prints the summary values reported in the Abstract. Random numbers are seeded (set.seed(2025); clusterSetRNGStream(cl, 2025) in parallel mode). Results are reproducible for the same number of cores (N_CORES); sequential and parallel runs use different random-number streams and give slightly different Monte Carlo values.
Institutions
- Hasanuddin UniversitySouth Sulawesi, Makassar