3.1. Data Generation and Model Specification
The primary objective of the simulation experiment is to evaluate the performance of the Bayesian fixed effects (BFE) and Bayesian random effects (BRE), classical fixed effects (FE), classical random effects (RE), classical pooled ordinary least squares (OLS), and linear mixed effects (LME) models. We can then evaluate the best models to design for panel variable selection. In this work, we simulate panel datasets with
N = 100 and 200 units observed at
T = 10 and 20 time periods. Three covariates are generated with
and
with unit-level random intercepts for each unit
where
. The response variable
is structured according to a nonlinear data-generating process as:
This specification is designed to test the availability of panel variable selection under both nonlinear covariate effects and cross-sectional dependence assuming the realistic scenarios. In this way, we can also observe if can still have a causal effect on simulated y in our models.
We considered both classical models and Bayesian hierarchical models; the classical panel methods comprised pooled ordinary least squares (pooled OLS), within (fixed effects) and random effects models implemented using the “plm” R package, while the linear mixed effects model was estimated using the “lme4” R package. On the other hand, Bayesian hierarchical panel models were implemented via the “brms” R package, with the “cmdstanr” R package backend. These Bayesian models incorporated both fixed and random effects for better comparison with classical FE and RE models. In addition, Bayesian FE and RE provide flexible modeling of nonlinear relationships through the inclusion of important covariates. Weakly informative priors were applied to let the data to govern inference, and posterior distributions were sampled using two Markov chains of 1000 iterations each with 500 warm-ups.
The performance of classical and Bayesian models was systematically evaluated using multiple dimensions. The goodness-of-fit was computed using . Parameter estimates were evaluated by comparing estimated means against the true values generated in the simulation. While the stability of Bayesian models was weighed across repeated simulation runs, diagnostic checks were conducted to certify that model assumptions were satisfactorily satisfied. Residual analyses focused on normality and homoscedasticity in detecting potential misspecifications or violations that could affect modeling inference. Plus, the several metrics, namely, prediction accuracy, residual normality, residual homoscedasticity, model fit quality, convergence, computational efficiency, and interpretability, were used to assess the practical feasibility of each modeling approach.
From the simulations, variable importance or rank was measured through an advanced permutation-based method adapted for Bayesian modeling. This approach involved permuting the values of each input predictor while preserving correlations among covariates exceeding a threshold 0.3, thereby isolating the contribution of individual covariates to predictive performance. To ensure stability, each permutation was repeated 20 times, and results were summarized using means, standard deviations, and 90% credible intervals. Local importance metrics at the observation level further facilitated the detection of unit-specific contributions.
3.2. Simulation Results
This subsection presents the estimation results from two sample simulations.
Table 1 reports the estimation results from the classical panel models including the pooled OLS, fixed effects (FE), random effects (RE), and linear mixed effects (LME) estimators for simulated datasets with
N = 100,
T = 10 and
N = 200,
T = 20. In the small sample size, the covariate
consistently exhibits a strong positive and significant effect on Y across all classical models. The nonlinear specified term
is significant in every model that reveals the intended quadratic relationship. In contrast,
shows a negative and insignificant influence on Y. Goodness-of-fit measures show that pooled OLS and classical RE perform best compared to FE and LME models. For the second panel (simulation 2), the results remain robust and consistent. The estimated effect of
increases marginally to approximately 1.84 across all models, while
remains statistically significant with coefficients near 1.95. The covariate
continues to exhibit a weak and insignificant effect on Y. The model fit improves slightly for the larger sample dataset, showing a stable performance as the sample size rises.
Table 2 shows the posterior estimates from the Bayesian fixed and random effects models for the same simulated datasets. The results are remarkably consistent with those obtained from the classical estimators. For both sample sizes, the means of
and
are statistically significant and closely approximate their true values, with posterior standard errors remaining small. The posterior distributions offer full uncertainty quantification and model convergence as well as effective sample sizes to ensure the stable and reliable Bayesian inference.
Model diagnostics and predictive performance of each model are provided in
Table A1 (see
Appendix A) and
Table 3. The results indicate Bayesian models achieve excellent predictive accuracy, while computational efficiency favors classical models. In sum, it highlights the strength of Bayesian panel modeling. Therefore, we estimate panel variable selection using Bayesian fixed effects and random effects models. While the BFE model also performs well, BRE demonstrates the best model for the simulated panels.
Figure 1 and
Figure 2 present the simulated variable importance rankings and corresponding posterior mean importance scores under Bayesian fixed effects and Bayesian random effects models. The results show that
and
consistently exhibit substantially higher importance than
, particularly under the random effects specification. This pattern is fully consistent with the data-generating process, in which
and
enter the outcome equation, while
has no causal effect.
Figure A1 and
Figure A2 provided in
Appendix B compare the parameter estimates for fixed effects and random effects across two simulated panels. They confirm that
has no significant causal effect on
in our models. Next, we estimate Bayesian PVS models to check the variable importance as simulated, and the results confirm that only
and
are important variables or covariates. To double validate the choice of Bayesian random effects model, we further conducted the Hausman test as a robustness check (see
Table 4). For two panels, the chi-squared statistics are small and provide weak evidence against the null hypothesis that the random effects are consistent. Thus, these results reveal the BRE model as the optimal choice for panel variable selection. Methodologically, the simulation studies have confirmed that Bayesian panel models provide reliable inference under unobserved heterogeneity.