Next Article in Journal
Temporal Dynamics of User Engagement in Professional Video Communities: A Time-Series Clustering Analysis Based on Bilibili’s Legal Content
Previous Article in Journal
Perfect Controlled Multi-Output Teleportation of Single-Qubit States via a High-Dimensional Partially Entangled Channel
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

MixedBayes: An R Package for Longitudinal Gene–Environment Interaction Analysis Using Robust Sparse Bayesian Mixed Models

1
Department of Biostatistics and Data Science, The University of Texas Health Science Center at Houston School of Public Health, Houston, TX 77030, USA
2
Department of Statistics, Kansas State University, Manhattan, KS 66506, USA
*
Author to whom correspondence should be addressed.
Entropy 2026, 28(6), 649; https://doi.org/10.3390/e28060649
Submission received: 23 April 2026 / Revised: 25 May 2026 / Accepted: 29 May 2026 / Published: 9 June 2026

Abstract

Robust variable selection methods have emerged as powerful tools for dissecting high-dimensional gene–environment interactions in longitudinal studies, owing to their ability to accommodate intra-cluster correlations, capture structured sparsity, and handle heavy-tailed repeated measures. Despite these advantages, variable selection-based interaction analysis still suffers from a lack of valid inferential tools to quantify the uncertainty associated with important gene–environment interactions. In this paper, we introduce the R package mixedBayes (version 0.2.5), which implements fully Bayesian robust mixed-effects models proposed in recent work for high-dimensional longitudinal gene–environment interaction analysis. Specifically, the package considers two major classes of mixed models. The first accommodates interactions between omics features and treatment effects arising from repeated-measures one-way ANOVA with high-dimensional genetic factors. The second provides a more general framework for modeling interactions between individual genetic main effects and environmental factors. Both models enable posterior Bayesian inference via Markov chain Monte Carlo (MCMC). We provide detailed numerical examples and accompanying R code to facilitate robust interaction analysis using mixedBayes. In addition, a case study based on longitudinal asthma data with high-dimensional SNP measurements is presented.

1. Introduction

Variable selection and hypothesis testing are the two primary statistical frameworks for conducting gene–environment (G×E) interaction analysis [1,2,3]. Due to the high dimensionality of genetic factors, G×E analysis is well-suited to penalized variable selection methods. In particular, since outlying disease outcomes are frequently encountered owing to heterogeneity of complex diseases, robust variable selection methods have been developed for G×E interaction studies [4,5,6,7]. Despite these technical advances, a major limitation of penalized interaction analysis is the lack of uncertainty quantification. In contrast to statistical test-based methods that routinely provide p-values, regularized variable selection and its extensions in gene–environment interaction studies struggle to deliver valid inferential measures. This issue is further exacerbated in robust variable selection, where non-differentiable loss functions make it even more challenging to establish the asymptotic properties and resulting inference procedures in terms of confidence intervals, p-values, and false discovery rates (FDRs).
Longitudinal G×E analysis poses an additional layer of challenge for high-dimensional inference, as both phenotypic responses and omics predictors are repeatedly measured over time [1]. Consequently, intra-cluster correlations must be appropriately modeled. Statistical inference for high-dimensional longitudinal data has been addressed in only a limited number of frequentist studies, including penalized generalized estimating equations (PGEEs) [8] and high-dimensional mixed-effects models developed using de-biased LASSO [9,10]. Inference procedures of these studies are valid only under Gaussian errors, as GEE is known to be sensitive to even a single outlier [11], and the de-biased LASSO [12,13] has been shown to exhibit inferior performance in variable selection and statistical inference under data heterogeneity in empirical studies [14]. Robust inference, therefore, remains an important yet largely underexplored problem for frequentist longitudinal interaction studies.
Robust, fully Bayesian methods have recently emerged as a promising approach for inference under skewed model errors in longitudinal interaction studies. Among existing studies, Fan et al. (2025) [15] have developed a Bayesian quantile mixed-effects model for longitudinal treatment-by-genetic interaction analysis under a repeated-measures one-way ANOVA framework, where interactions are modeled at the group level between treatment indicators and lipid features. In addition, Li et al. (2025) [16] have considered a more general interaction setting, where interactions are modeled at the individual level as products between environmental factors and high-dimensional genetic variables. Both models and the alternatives are implemented in the R package mixedBayes, which is available on CRAN.
To better understand the advantages and limitations of the mixedBayes package for analyzing repeated-measures data, we provide a non-exhaustive list of R packages for sparse longitudinal data analysis in Table 1, which covers diverse methodological frameworks such as mixed-effects models, generalized estimation equations (GEEs) [17], fully Bayesian analysis, and tree-based machine learning, among others. While all these tools are well developed for repeated-measures data, only a small subset—namely, springer [18,19], interep [20,21], and mixedBayes [15]—are tailored for high-dimensional longitudinal interaction studies. Among them, springer achieves robustness through the quadratic inference function (QIF) framework [22], whereas mixedBayes attains robustness via a robust likelihood formulation.
Statistical inference in such settings remains particularly challenging. Among the listed packages, only PGEE, plsmmLasso and mixedBayes provide high-dimensional inference procedures, with mixedBayes further offering robust inference in the presence of outliers in phenotypic responses. It is also worth noting that mixed-effects models can be extended to incorporate tree-based methods, such as decision trees and random forests, for analyzing longitudinal data [23]. Packages such as MultivariateRandomForest and LongituRF can perform variable selection via variable importance measures. However, tree-based machine learning typically prioritizes predictive performance over statistical inference and, thus, lacks principled uncertainty quantification measures.
Overall, Table 1 highlights a notable gap in current tools. The mixedBayes package uniquely addresses this gap by integrating high-dimensional longitudinal modeling, interaction analysis, and robust statistical inference within a unified Bayesian framework. In this paper, we focus on the practical implementation of the Bayesian longitudinal analysis frameworks proposed in Fan et al. (2025) [15] and Li et al. (2025) [16], implemented via the R package mixedBayes. Spike-and-slab priors are incorporated in both robust Bayesian mixed models and play a critical role in conducting variable selection and posterior inference. Specifically, Fan et al. (2025) [15] adopt the median probability model (MPM) [24] to identify individual-level main effects and group-level G×E interactions, whereas Li et al. (2025) [16] perform the ranking and selection of important main and interaction effects using a Bayesian false discovery rate (FDR)-assisted procedure based on posterior inclusion probabilities (PIPs) derived from spike-and-slab priors. We illustrate the use of the mixedBayes package through detailed instructions and numerical examples, demonstrating how to implement median probability models (MPMs) and Bayesian FDR-based procedures. The R package mixedBayes (version 0.2.5) is available at https://cran.r-project.org/package=mixedBayes (accessed on 23 April 2026).
Table 1. An incomplete list of R packages for sparse longitudinal data analysis in moderate- and/or high-dimensional settings.
Table 1. An incomplete list of R packages for sparse longitudinal data analysis in moderate- and/or high-dimensional settings.
PackageMethodApplicationRobustInferenceReferences
mixedBayesBayesianG×E interactionYesYes[15,16]
bayeslongitudinalBayesianMain effect modelingNoYes[25]
geeVerseGEEMain effect modelingPartiallyNo[26]
springerQIF [22]G×E interactionYesNo[18,19]
interepGEEG×E interactionNoNo[20,21]
PGEEGEEMain effect modelingNoYes[8,27]
pgee.mixedGEEMedical Expenditure Panel Survey (MEPS)NoYes[28]
OmicPredMixed modelAlzheimer’s Disease Neuroimaging Initiative (ADNI)NoNo[29]
plsmmLassoMixed modelOral Microbiome in Early Infancy (OMEI) studyNoYes[10]
glmmLASSOGLMMLongitudinal and clustered dataNoNo[30]
REEMtreeTree-based mixed modelTransaction data and accident fatality dataNoNo[31]
Multivariate-
RandomForest
Tree-basedMultivariate outcome predictionNoNo[32,33]
LongDatGLMMlongitudinal microbiome studiesNoYes[34]
LongituRFTree-based mixed modelHIV vaccine trial with 20,000 gene transcriptsNoNo[35,36]

2. Two Major Longitudinal Interaction Models

Before we introduce the two major robust Bayesian longitudinal interaction models implemented in the R package mixedBayes [15,16], let us first review the prototype G×E model in non-robust, low-dimensional settings. A standard gene–environment interaction model with the environmental main effect E i , and genetic main effect G i , as well as their interaction E i G i under continuous disease phenotype Y i for the ith subject ( i = 1 , . . . , n ), can be expressed as
E ( Y i ) = β 0 + β 1 E i + β 2 G i + β 3 E i G i ,
where β 1 , β 2 and β 3 are regression coefficients representing main environmental, genetic and interaction effects. In frequentist G×E studies, uncertainty quantification can be performed by testing the significance of these coefficients. In a one-way ANOVA setting with (for example) 3 treatment levels denoted using the environmental factor E i , the baseline model (1) leads to
E ( Y i ) = β 0 + β 1 E 1 i + β 2 E 2 i + β 3 G i + ( β 4 E 1 i + β 5 E 2 i ) G i ,
where E 1 i and E 2 i are binary indicators representing the categorical E factor E i for the ith subject. Statistical inference becomes increasingly challenging when the disease phenotype is repeatedly measured in the presence of outliers, as the genetic factors are high-dimensional and G×E interactions are of a group structure, motivating the development of sparse Bayesian quantile mixed-effects models implemented in the R package mixedBayes [15]. Moreover, under heavy-tailed model errors, Li et al. (2025) [16] have considered a direct extension of model (1) to a high-dimensional case without requiring a grouping structure of environmental factors. Next, we present the two longitudinal models in more detail.

2.1. Bi-Level Sparse Bayesian Quantile Mixed-Effects Model

In a longitudinal study with n subjects observed at k time points, let Y i t denote the phenotype and G it R p and E it R q denote the genetic and categorical treatment factors for subject i at time t  ( 1 i n , 1 t k ) such that G it = ( G i t 1 , , G i t p ) and E it = ( E i t 1 , , E i t q ) , respectively. The time-dependent E it includes classical repeated-measures ANOVA with time-invariant factors as a special case. To model main and interaction effects under longitudinal phenotypes with skewed distributions, Fan et al. (2025) [15] consider the following bi-level quantile mixed-effects model at a specified quantile level θ ( 0 < θ < 1 ) ,
Y i t = T it β 0 , θ + E it β 1 , θ + G it β 2 , θ + ( G it E it ) β 3 , θ + Z it α i , θ + ϵ i t , θ .
where “bilevel” refers to modeling main effects at the individual level and interaction effects at the group level. The model includes fixed effects β 0 , θ , β 1 , θ , β 2 , θ , and β 3 , θ , corresponding to time effects T it (including an intercept term), treatment factor E it , genetic factor G it , and treatment – genetic interactions G it E it , respectively. The interaction term G it E it is a p q -dimensional Kronecker product:
G it E it = [ G i t 1 E i t 1 , , G i t p E i t q ] .
Model (2) induces correlations among repeated measures through subject-specific random effects α i , θ R h . The time covariate Z it R h represents a random intercept model when h = 1 , and a random intercept–slope model when h = 2 . The model errors ϵ i t , θ are assumed to be independent, with their θ th quantile being zero. For notational simplicity, we omit the subscript “ θ ” on the fixed and random effects hereafter.
Robust likelihood. We refer readers to Fan et al. (2025) [15] for details on specifying the robust likelihood for model (2) based on the asymmetric Laplace distribution (ALD) [37,38,39], which has been adopted in Bayesian regularized quantile regressions that yield valid inference measures in high-dimensions [14]. We acknowledge that several other robust likelihood functions have been studied in sparse linear regression models, but have not yet been explored under mixed-effects models [40,41].
Bi-level shrinkage priors. To identify important main and interaction effects, we assign structured shrinkage priors to the fixed-effect coefficients β 1 = ( β 11 , , β 1 q ) , β 2 = ( β 21 , , β 2 p ) , and β 3 = ( β 31 , , β 3 p ) , where β 3 g = ( β 3 g 1 , , β 3 g q ) for g = 1 , , p . These correspond to environmental main effects, genetic main effects, and their interactions, respectively.
To select group-level interaction effects, we assign the following multivariate spike-and-slab priors,
β 3 g | ϕ 2 g , s 2 g ϕ 2 g N q ( 0 , s 2 g I q ) + ( 1 ϕ 2 g ) δ 0 ( β 3 g ) , ϕ 2 g Bernoulli ( π 2 ) , s 2 g Gamma q + 1 2 , η 2 2 2 ,
where δ 0 ( · ) denotes a point mass at zero. The binary latent variable ϕ 2 g indicates whether the interaction effect for the gth genetic factor is selected ( ϕ 2 g = 1 ) or excluded ( ϕ 2 g = 0 ). When ϕ 2 g = 1 , the hierarchical prior reduces to a multivariate Laplace prior, corresponding to the Bayesian quantile group LASSO. By integrating out ϕ 2 g and s 2 g , we obtain the following multivariate spike-and-slab prior,
β 3 g | η 2 π 2 M - Laplace ( β 3 g | η 2 ) + ( 1 π 2 ) δ 0 ( β 3 g ) ,
where π 2 [ 0 , 1 ] .
To identify individual-level genetic main effects, we impose univariate spike-and-slab priors,
β 2 g | ϕ 1 g , s 1 g ϕ 1 g N ( 0 , s 1 g ) + ( 1 ϕ 1 g ) δ 0 ( β 2 g ) , ϕ 1 g Bernoulli ( π 1 ) , s 1 g Gamma 1 , η 1 2 2 ,
where the parameter π 1 [ 0 , 1 ] . When ϕ 1 g = 1 , this prior reduces to a Laplace shrinkage prior; otherwise, β 2 g = 0 , indicating no main effect for gene g.

2.2. FDR-Assisted Robust Sparse Bayesian Linear Mixed Model

Li et al. (2025) [16] have considered a more general extension of model (1) in a longitudinal interaction study with n subjects and k repeated measures for each observation. For the ith subject ( 1 i n ) , the disease trait Y i t , genetic factors G it = ( G i t 1 , , G i t p ) , and environmental factors E it = ( E i t 1 , , E i t q ) are measured at time point t  ( 1 t k ) . Li et al. (2025) [16] have proposed the following robust longitudinal mixed-effects model,
Y i t = X it γ 0 + E it γ 1 + G it γ 2 + ( G it E it ) γ 3 + Z it α i + ϵ i t ,
where X it represents the time effects (including an intercept term). To distinguish from the bi-level quantile mixed model in Section 2.1, we use γ to denote fixed effects in mixed model (3), with the order of genetic and environmental main effects adjusted to match variable dimensions. The fixed effects γ 1 R q , γ 2 R p , and γ 3 R p q correspond to the genetic main effects, environmental main effects, and their interactions, respectively. The interaction effects are constructed via the Kronecker product:
G it E it = [ G i t 1 E i t 1 , G i t 1 E i t 2 , , G i t 1 E i t q , G i t 2 E i t 1 , , G i t p E i t q ] .
In model (3), the random effect α i and associated time effects Z it are defined the same as in model (2). For a random intercept–slope model, Z it = ( 1 , t ) and α i R 2 ; for a random intercept model, Z it = 1 and α i reduces to a scalar. The error terms ϵ i t are assumed to be independent and follow a heavy-tailed distribution to ensure robustness against outliers.
Model (3) differs from model (2) in that it is not derived from a repeated-measures one-way ANOVA framework; thus, the environmental factors are not restricted to categorical variables. Consequently, the group-level interaction structure in model (2) no longer exists, and all main and interaction effects are modeled at the individual level.
Robust likelihood and shrinkage priors
Li et al. (2025) [16] have adopted a Laplace distribution to build the robust likelihood function. The following shrinkage priors are adopted to detect important main and interaction effects.
For genetic main effects, we assign univariate spike-and-slab priors,
γ 2 g | ϕ 1 g , s 1 g ϕ 1 g N ( 0 , s 1 g ) + ( 1 ϕ 1 g ) δ 0 ( γ 2 g ) , ϕ 1 g Bernoulli ( π 1 ) , s 1 g Gamma 1 , η 1 2 2 .
where the parameter π 1 [ 0 , 1 ] and g = 1 , , p . For interaction effects, we also impose univariate spike-and-slab priors,
γ 3 l | ϕ 2 l , s 2 l ϕ 2 l N ( 0 , s 2 l ) + ( 1 ϕ 2 l ) δ 0 ( γ 3 l ) , ϕ 2 l Bernoulli ( π 2 ) , s 2 l Gamma 1 , η 2 2 2 .
where l = 1 , , p q and the parameter π 2 [ 0 , 1 ] .
Remark 1.
The difference between model (2) and model (3) is that model (2) is designed for a repeated-measures one-way ANOVA setting, where the environmental factors correspond to groups of binary treatment indicators, and the associated gene–environment interactions, therefore, possess a grouped structure. In contrast, model (3) does not impose such a grouping restriction, and the gene–environment interactions are modeled individually rather than at the group level. Therefore, model (3) is not applicable to one-way ANOVA setting since it violates the grouping structure. In addition, model (3) also differs from model (2) in its variable selection criterion. Specifically, model (2) employs the median probability model (MPM) [24,42], using a cutoff of 0.5 for posterior inclusion probabilities to determine selected predictors. In contrast, Li et al. (2025) [16] propose using a Bayesian FDR-controlled adaptive threshold as the cutoff for variable selection in model (3). We also note that, since the environmental main effects are not subject to selection under both models, the resulting specifications satisfy the weak hierarchy in interaction studies [6,43].

2.3. Additional Priors

For both models (2) and (3), described in Section 2.1 and Section 2.2, respectively, we assign normal priors to the subject-specific random effects. Under a random intercept–slope model, α i N ( 0 , ϕ 2 I ) , and under a random intercept-only model, α i N ( 0 , ϕ 2 ) .
We specify Beta hyperpriors for the inclusion probabilities, π 1 Beta ( r 1 , w 1 ) and π 2 Beta ( r 2 , w 2 ) , and Gamma priors for the shrinkage parameters, η 1 2 Gamma ( a 1 , b 1 ) , η 2 2 Gamma ( a 2 , b 2 ) , and τ Gamma ( c , d ) . For the variance of the random effects, we impose an inverse-gamma prior, ϕ 2 IG ( e , f ) . Unless otherwise specified, we set these hyperparameters to 1 to reflect diffuse prior choices. A detailed hyperparameter sensitivity analysis can be found in Section B.6 of the Appendix in Fan et al. (2025) [15], which suggests that the model performance is not sensitive to the choice of hyperparameters. Therefore, for convenience of use, the current mixedBayes package sets all hyperparameters to 1 by default. Please refer to Fan et al. (2025) [15] and Li et al. (2025) [16] for derivations of the Gibbs samplers and associated MCMC algorithms.

3. R Package mixedBayes

The mixedBayes package provides a unified framework for fitting Bayesian regularized quantile mixed models in longitudinal gene–environment (G×E) interaction studies. The core function, mixedBayes(), implements robust sparse mixed-effect modeling proposed for the aforementioned two major longitudinal interaction studies [15,16]. The package accommodates bi-level sparsity through structured spike-and-slab priors [15] and supports robust quantile modeling based on the asymmetric Laplace distribution. Alternative methods using non-sparse Laplace priors and/or non-robust Gaussian likelihoods are also included. To ensure computational efficiency, the MCMC algorithms are implemented in C++. In addition to the core modeling function, the package includes several supporting utilities, such as reformat(), predict_mixedBayes(), and selection(), which facilitate data pre-processing, model-based prediction, and variable selection, respectively.

3.1. Data Pre-Processing Utilities

The package requires all input data (response, genetic, and environmental factors) to be in the long format. It provides one auxiliary function, reformat(), to prepare long-format longitudinal data. The mixedBayes() function automatically constructs gene–environment (G×E) interaction terms internally using the Kronecker product of the genetic and environmental factors, as described in Section 2.1 and Section 2.2. Therefore, users only need to provide the main-effect design matrices, without explicitly specifying the interaction matrix. The function reformat() converts repeated-measures data into the required long format. For example, when the response is stored in wide format (subjects in rows and time points in columns), reformat() transforms it into a stacked vector indexed by subject and time. It also expands subject-level covariates to align with the longitudinal design.
As an illustration, consider a study with 200 subjects, each with the response variable measured at five time points, along with 100 genetic factors and three environmental factors. The cross-sectional genetic and environmental matrices have dimensions of 200 × 100 and 200 × 3 , respectively. The function reformat(5, y, type = “r”) expands the phenotypic response to a 1000 × 1 vector, while reformat(5, g, type = “d”) and reformat(5, e, type = “d”) expand the genetic and environmental matrices to dimensions of 1000 × 100 and 1000 × 3 , respectively, thereby matching the long-format structure. The current version of mixedBayes() assumes a longitudinal response, with genetic and environmental factors treated as cross-sectional covariates.

The Core Functions

In the R package mixedBayes, the core function is mixedBayes(y, e, X, g, k, iterations, burn.in, slope, robust, quant, sparse, structure). It fits a Bayesian longitudinal regularized quantile mixed model tailored for high-dimensional gene–environment interaction (G×E) studies under repeated measurements. The input arguments y, e, X, and g correspond to the response vector, environmental covariates (or treatment indicator groups), time-effect covariates (including an intercept term), and genetic factors, respectively. The argument k denotes the number of repeated measurements per subject. The argument slope specifies the type of mixed-effects models: if slope = TRUE, a random intercept-and-slope model is used; otherwise, a random intercept model is fitted. The robust option enables quantile modeling using an asymmetric Laplace distribution, with the quantile level specified by quant. When robust = FALSE, the model uses a Gaussian likelihood function. Sparsity structures can be imposed via the arguments structure and sparse. When sparse = TRUE, spike-and-slab priors are adopted to induce exact sparsity. If sparse = FALSE, Laplacian shrinkage priors are used instead, and exact sparsity cannot be achieved. When structure=bilevel”, bi-level selection on main and interaction effects will be conducted corresponding to individual and group levels, respectively, as described in Fan et al. (2025) [15]. When structure=individual”, selections only on individual-level G and E effects will be performed, as shown in Li et al. (2025) [16].
The function returns a mixedBayes object containing posterior summaries, including posterior median estimates of the model parameters, which are used for subsequent performance evaluation. A total of 2 (robust vs. non-robust) × 2 (random intercept vs. intercept-and-slope) × 2 (bi-level vs. individual structure) × 2 (spike-and-slab vs. Laplacian) = 16 models are available. The number of MCMC iterations and the burn-in period are specified through arguments iterations and burn.in, respectively. If burn.in is set to NULL, no burn-in is applied, and posterior samples from all MCMC iterations are retained for estimation and inference.

3.2. Bayesian Variable Selection

In Bayesian hierarchical models, shrinkage priors determine how variable selection is conducted. The selection() function in the package mixedBayes implements two criteria: the median probability model (MPM) for spike-and-slab methods and 95% credible intervals for Laplace prior-based methods. In addition, the Bayesian FDR approach can be applied to spike-and-slab models to select important features under FDR control. Further details are provided below.

3.2.1. Median Probability Model (MPM) Criterion

The treatment variable considered in the repeated-measure one-way ANOVA setting in Fan et al. (2025) [15] is categorical, leading to a group of binary indicators (dummy variables). By setting structure=bilevel", the package performs variable selection on the main effects at the individual level and the interaction effects at the group level simultaneously.
Variable selection on the returned mixedBayes object is performed using function selection(), which extracts relevant main and interaction effects based on posterior samples generated from MCMC. When sparse = TRUE, selection follows the median probability model (MPM) strategy [24,42]. Let S denote the number of retained MCMC iterations after discarding burn-ins, and let δ j ( s ) { 0 , 1 } indicate whether the jth predictor is included in the model at iteration s. Then, the posterior inclusion probability (PIP) for the jth predictor is computed as
π j = 1 S s = 1 S δ j ( s ) , j = 1 , , d ,
where d represents the total number of main and interaction effects subject to selection. Under the MPM criterion, predictors with π j 0.5 stay in the final model, yielding a sparse representation that keeps signals with strong posterior support while excluding irrelevant ones. The function selection() returns a binary indicator vector, where each component indicates whether the corresponding feature (main or interaction effect) is selected (denoted as 1) or not (denoted as 0).

3.2.2. 95% Credible Interval Criterion

Among the 16 models implemented in the R package mixedBayes, 8 are based on Laplace shrinkage, for which the MPM is not applicable. In this case, setting sparse = FALSE enables variable selection based on posterior credible intervals: a predictor is selected if the corresponding 95% credible interval for its coefficient does not contain zero. The output of the selection() function is also a binary indicator vector specifying whether each effect is selected.

3.2.3. Bayesian False Discovery Rate (FDR) Criterion

Under spike-and-slab priors, posterior inclusion probabilities (PIPs) quantify the strength of association between each main effect or interaction effect and the longitudinal response. Accordingly, PIPs can be used to rank their importance. In contrast to the fixed 0.5 cutoff in the MPM criterion, Bayesian FDR procedures yield adaptive thresholds that may improve performance in certain settings. Methodological developments on using Bayesian FDR to construct adaptive selection thresholds, as well as applications in genomics studies, are available in [44,45,46], among others. By construction, such adaptive thresholds are largely model-independent in the sense that, once spike-and-slab priors are incorporated into a Bayesian hierarchical model, the thresholds can be readily computed based on the posterior properties induced by the spike-and-slab formulation. This approach has demonstrated good empirical performance in main effect models [44,46]. Li et al. (2025) [16] have further considered it in gene–environment interaction studies by proposing a Bayesian FDR approach for selecting important main and interaction effects in robust linear mixed models for longitudinal interaction studies, which can be conducted using the package mixedBayes. Li et al. (2025) [16] have also demonstrated through numerical studies that, under repeated data generation from the true underlying model, the corresponding Bayesian FDR procedure effectively controls the overall proportion of false discoveries near the nominal level, supporting its practical utility in interaction models.
Specifically, when structure=individual”, variable selection is performed at the individual predictor level for both main and interaction effects [16]. Variable selection performance is evaluated using the Bayesian false discovery rate (FDR) defined in Equation (4) below. For a given cutoff τ ( 0 , 1 ) , all effects satisfying π j > τ are declared as discoveries. The corresponding Bayesian FDR is defined as
FDR ( τ ) = j = 1 d ( 1 π j ) I ( π j > τ ) j = 1 d I ( π j > τ ) ,
where 1 π j represents the posterior probability that the jth effect is null and I ( · ) is the indicator function. This quantity can be interpreted as the expected proportion of false discoveries among all selected main and interaction effects. To identify important effects under FDR control, we first sort the PIPs in descending order,
π ( 1 ) π ( 2 ) π ( d ) .
If the top m predictors are selected ( m = 1 , . . . , d ), the corresponding Bayesian FDR can be written as
FDR π ( m ) = 1 1 m i = 1 m π ( i ) .
Given a target FDR level c ( 0 , 1 ) , we choose
m * = max m : FDR π ( m ) c , τ ^ = π ( m * ) .
All predictors with π j > τ ^ are then selected. This adaptive strategy determines the selection threshold directly from the posterior evidence and guarantees that the expected proportion of false discoveries among the selected predictors is controlled at the prespecified level c. We refer readers to the numerical studies in Li et al. (2025) [16], which demonstrate that the Bayesian FDR is well controlled while achieving satisfactory identification performance in the presence of heavy-tailed repeated measurements.

3.3. Prediction Function

In addition to parameter estimation and variable selection, the package mixedBayes also provides functionality for model-based prediction. Given a fitted mixedBayes object, predictions for repeated-measurement outcomes can be obtained using the predict_mixedBayes() function. This function computes fitted values using posterior median estimates of the fixed effects—corresponding to time-effect covariates, environmental effects, and genetic main effects—as well as subject-specific random effects. Gene–environment interaction terms are automatically constructed internally and incorporated into prediction and, therefore, do not need to be supplied by the user. Depending on the specification of the logical argument slope, the function accommodates either a random intercept model or a random intercept-and-slope model. Predicted responses are obtained using posterior median estimates of both fixed and random effects, and prediction accuracy is summarized by the mean absolute error (MAE) or mean squared error (MSE) between the observed and predicted outcomes. Specifically, let y ^ i t denote the corresponding fitted value computed using the posterior median. Then, MAE is defined as
MAE = 1 n k i = 1 n t = 1 k | y i t y ^ i t | ,
and MSE is defined as
MSE = 1 n k i = 1 n t = 1 k ( y i t y ^ i t ) 2 ,
The function returns an object of class mixedBayes.pred, which contains the vector of predicted response values for the repeated measurements, as well as the associated prediction error.

4. Simulation Examples

We illustrate how to use the R package mixedBayes to perform high-dimensional longitudinal interaction analyses [15,16]. Consider the random intercept-and-slope models (2) and (3) described in Section 2.1 and Section 2.2, respectively. Let n denote the sample size, p the number of genetic factors, q the number of environmental factors, and k the number of repeated measurements. Under both models, we generate a dataset with n = 200 subjects, p = 100 genetic factors, q = 3 environmental factors, and k = 5 time points per subject. The generation of environmental factors differs between models (2) and (3); see Section 4.1 and Section 4.2 for details. For both models, the genetic factors g are simulated from a multivariate normal distribution with an AR(1) covariance structure, marginal variance 1, and autocorrelation coefficient ρ = 0.5 . Detailed R codes for data generation and analysis using the mixedBayes package are provided below.

4.1. Bi-Level Modeling Under Bayesian Regularized Quantile Mixed Model

4.1.1. Variable Selection Using the MPM

In the repeated-measure one-way ANOVA design with high-dimensional genetic factors introduced in Section 2.1, the environmental factors are a group of dummy variables indicating treatment groups. Gene–environment interactions, denoted by w , are then constructed internally in the package mixedBayes as the Kronecker product of the genetic and environmental factors. In the data-generating codes provided below, the coefficient vector β 3 true representing interaction effects is initialized as a sparse vector, where nonzero values are assigned to a subset of elements in the vector. In addition, a sparse coefficient vector β 2 true denoting the genetic main effects is also generated. The two vectors, β 2 true and β 3 true , represent fixed effects that are subject to selection. Time-effect covariates X it = ( 1 , t , t 2 ) are included to model longitudinal trends. The random effect design matrix Z it includes both the intercept and slope terms. Random effects α i are simulated for each subject to capture intra-subject correlation. According to model (2), the time-point-specific response y i t is generated from the combined time effects, G×E main and interaction effects, and subject-specific random effects, with an additional error term independently drawn from a heavy-tailed distribution, specifically a t ( 2 ) distribution, in the following R example. All the variables that will be used later on as input for the mixedBayes package, including the response and covariates (genetic, environmental, and time-related), are required to be in a long format. The output includes the response vector y , covariates g , e and time effects X in a long format, and the true coefficients, stored as coef. The corresponding R code and its output are shown below. The code can also be accessed through the Figshare repository listed in the Data Availability Statement. Entropy 28 00649 i001aEntropy 28 00649 i001bEntropy 28 00649 i001c
Moreover, the nonzero coefficients used in the data-generating process are stored in data$coef. By setting a random seed, the simulated dataset can be reproduced by re-running the Data function. With 100 genetic factors and 3 environmental variables, the model includes a total of 403 covariates representing main and interaction effects (excluding the intercept). Except for the 3 environmental main effects, all 400 genetic main effects and G×E interactions are subject to selection. We use the function mixedBayes to perform robust Bayesian bi-level variable selection at the 50% quantile level, imposing exact sparsity on the fixed effects via spike-and-slab priors. Posterior samples are collected via Gibbs samplers with 10,000 MCMC iterations, of which the first 5000 are treated as burn-ins, and Bayesian estimates are computed using posterior medians. The corresponding R code is as follows: Entropy 28 00649 i002
Since the true active predictors are known from the data-generating mechanism, their indices (index) can be obtained from the true coefficient vector (coeff). Identification performance is then evaluated by comparing the selected predictors with the true active set. Specifically, the number of true positives (TPs) is defined as the number of correctly identified active predictors, while the number of false positives (FPs) corresponds to the number of inactive predictors that are incorrectly selected. There are 4 main effects and 18 interaction effects, for a total of 22 true effects. The implementation is illustrated in the following code:Entropy 28 00649 i003
With sparse = TRUE, the selection() function identifies selected predictors under the median probability model by returning a binary vector beta_est consisting of 1’s and 0’s, where 1 indicates that the corresponding predictor is selected and 0 otherwise. When sparse = FALSE, selected predictors are determined using the 95% credible interval criterion. In this example, we use the median probability model since it better accommodates the two-group structure of spike-and-slab priors. The true positives (TPs) and false positives (FPs) are displayed in the R console. 19 out of 22 true effects are correctly identified. To facilitate comparison, the positions of the true and estimated nonzero regression coefficients—stored in the variables index and pos, respectively—are also presented. The first 20 elements of coef_main and coef_interaction as output from the R console are listed below. Entropy 28 00649 i004aEntropy 28 00649 i004b

4.1.2. Estimation

We provide details on how parameter estimation is evaluated. In Fan et al. (2025) [15], the accuracy of the regression coefficient estimates is examined in terms of TMAD, MAD, and NMAD. Specifically, the total mean absolute deviation (TMAD) is defined as
TMAD = 1 M i = 1 M | β 2 ^ ( i ) β 2 true | + | β 3 ^ ( i ) β 3 true | p β 2 β 3 ,
where p β 2 β 3 denotes the total dimension of β 2 and β 3 , β 2 ^ ( i ) and β 3 ^ ( i ) are the estimates obtained from the ith simulated dataset, and M is the total number of simulation replications. In our R example, M = 1, as we only show model fitting based on one replicate. In addition, we report the mean absolute deviation computed separately for coefficients that are truly nonzero (MAD) and for coefficients that are truly zero (NMAD), thereby allowing separate assessment of estimation accuracy for signal and noise components. The above estimation criteria are computed based on posterior median estimates obtained from the fitted model. In the following, we show R codes to calculate estimation errors in terms of TMAD, MAD, and NMAD based on one simulation replicate.Entropy 28 00649 i005

4.1.3. Prediction

We use the function predict_mixedBayes from the R package mixedBayes to compute the prediction error in terms of the mean absolute error (MAE) across all subjects and observation times under model (2), where MAE is defined in Section 3.3. The R codes are shown below.Entropy 28 00649 i006aEntropy 28 00649 i006b

4.1.4. Computational Time

Based on the R example in Section 4.1.1, the computational times under different combinations of sample size n and total dimensionality q p + p + 1 are reported in Table 2, demonstrating that the mixedBayes package is computationally efficient.

4.1.5. Convergence

We assessed MCMC convergence using the potential scale reduction factor (PSRF) [47,48]. Values of the PSRF approaching 1 indicate that Markov chains converge to stationary distributions. We adopted a threshold of 1.1 as the convergence criterion, as recommended by Gelman et al. (1995) [49]. PSRFs have been computed for all nonzero coefficients representing the 22 true main genetic and interaction effects. Figure 1 shows that all chains achieve satisfactory convergence after removal of the burn-in samples. In addition, trace plots are shown in Figure A1 in the Appendix A.
To further assess convergence and sampling efficiency, we have additionally evaluated the effective sample size (ESS) based on four parallel MCMC chains after discarding the first 5000 iterations as burn-in. The ESS is defined as E S S = N 1 + 2 k = 1 ρ k , where N denotes the number of post-burn-in samples, and ρ k is the lag-k autocorrelation. Larger ESS values indicate lower autocorrelation and more efficient posterior sampling. The ESS values have been computed using the coda package in R [50]. Table 3 summarizes the ESS values for nonzero coefficients, zero coefficients, and all coefficients for both main effects and interaction effects. Overall, the results indicate adequate mixing behavior and satisfactory sampling efficiency of the proposed MCMC algorithm. As expected in high-dimensional sparse Bayesian models, and as illustrated in Table 3, the ESS can vary substantially across coefficients, particularly for sparse parameters. Therefore, ESS should be interpreted with caution when assessing sampling efficiency in high-dimensional settings.

4.2. Identification via Bayesian FDR Under a Robust Linear Mixed Model

To further illustrate the Bayesian FDR-based selection procedure for mixed models [16], we consider a simulation example corresponding to model (3) introduced in Section 2.2. Rather than generating environmental factors (and thus, G×E interactions) at the group level, as in Section 4.1, we simulate the environmental variables from a multivariate normal distribution with an autoregressive covariance structure, i j = 0.5 | i j | . Consequently, the interaction effects no longer follow a grouped structure. In the following data-generating code, the sparse coefficient vectors γ 2 true and γ 3 true , representing the main genetic effects and G×E interactions, are initialized as sparse regression coefficient vectors. Detailed R code is provided below and is also available at the Figshare repository listed in the Data Availability Statement section.Entropy 28 00649 i007aEntropy 28 00649 i007bEntropy 28 00649 i007c
Of the 400 main and interaction effects under selection, only 8 genetic main effects and 12 interaction effects have nonzero coefficients. The numbers of true positives (TPs) and false positives (FPs) are computed based on the predictors, with posterior inclusion probabilities (PIPs) beyond the adaptive cutoff determined by the Bayesian false discovery rate (FDR) procedure defined in Equation (4). The adaptive threshold is determined according to a global FDR level fixed at 5% (i.e., c = 0.05 ). R code for model fitting and variable selection is provided in the following R code: Entropy 28 00649 i008aEntropy 28 00649 i008b
After fitting model (3) described in Section 2.2, posterior samples of γ 2 and γ 3 that correspond to genetic main effects and G×E interactions are extracted. For each coefficient, the posterior inclusion probability (PIP) is computed as the proportion of posterior samples in which the coefficient is nonzero. The function Findpipcut determines a PIP cutoff based on Bayesian FDR control at the 0.05 level. Specifically, variables are ranked according to their PIPs, and the cutoff is selected such that the estimated average false discovery rate among the selected variables does not exceed 5 % .
The function Funct_estimate_beta then selects main and interaction effects whose PIPs exceed the Bayesian FDR cutoff. For selected effects, coefficient estimates are obtained using the posterior median, while non-selected coefficients are set to zero. Finally, the selected variables are compared with the true nonzero coefficients to evaluate variable selection performance in terms of true positives and false positives.

4.3. Remarks on R Examples

In both R examples presented in Section 4.1 and Section 4.2, the model errors are generated from a t ( 2 ) distribution. Compared with other commonly used heavy-tailed distributions, the t ( 2 ) distribution has infinite variance and, therefore, produces more extreme outliers. Comprehensive evaluations of model performance under Normal errors and other types of heavy-tailed model errors, including Laplace, contaminated Laplace mixtures, and skewed log-normal distributions, can be found in the numerical studies of Fan et al. (2025) [15] and Li et al. (2025) [16].
Currently, in both examples, the nonzero regression coefficients for important main and interaction effects are generated from Unif(0.2, 0.5). Users may explore different signal strengths, for example, stronger signals generated from Unif(0.4, 0.8), to further examine model performance. In addition, users may specify other types of model errors instead of t ( 2 ) to evaluate the robustness of the proposed methods under different error distributions. If interested, users can readily modify the above code to evaluate model performance averaged over multiple replications, along with corresponding standard deviations, under more challenging simulation settings.

5. Case Study

We utilized the package mixedBayes to analyze high-dimensional longitudinal data from the Childhood Asthma Management Program (CAMP) [51,52,53]. Access to the data may be requested through dbGaP using the accession number phs000166.v2.p1. In this study, children aged 5 to 12 years with a diagnosis of chronic asthma were enrolled in the study and followed for four years through scheduled visits. The outcome of interest is the forced expiratory volume in one second (FEV1), which measures the volume of air exhaled from the lungs within one second. We analyze longitudinal FEV1 measurements collected across 12 post-treatment visits under three treatment arms: budesonide, nedocromil, and placebo. In the original CAMP dataset, the treatment variable is encoded numerically, where trt = 4 corresponds to budesonide, trt = 8 corresponds to nedocromil, and trt = 9 corresponds to a placebo. In the repeated-measures one-way ANOVA design with the high-dimensional genetic factors introduced in Fan et al. (2025) [15], the treatment variable serves as the environmental factor and is encoded as a group of dummy variables. Specifically, trt_4 is defined as 1 for budesonide and 0 otherwise, and trt_8 is defined as 1 for nedocromil and 0 otherwise. Placebo is used as the baseline group. In addition, we include time effects through a design matrix X in the long format. Specifically, X consists of an intercept and the visit time (in months), where the first column is a vector of ones and the second column corresponds to the scheduled visit times. This matrix is constructed by repeating the visit times for each subject. With high-dimensional single-nucleotide polymorphisms (SNPs) as genetic factors, this study is exactly the longitudinal interaction study arising from the repeated-measure one-way ANOVA examined in Section 4.1. For demonstration purposes, we adopted the mixedBayes package to analyze a subset of 150 SNPs. Data formatting and model-fitting codes are provided below. Entropy 28 00649 i009aEntropy 28 00649 i009b
We have applied the robust Bayesian bi-level selection method under a random intercept-and-slope model to the real dataset using the mixedBayes function. Entropy 28 00649 i010
The mixedBayes function provides estimates for the intercept, time-related covariates, treatment indicators, genetic effects, and G×E interaction terms. We provide the selected genetic main effects and G×E interactions in Table 4. Specifically, the first column lists the identified SNPs, while the remaining columns report the estimated coefficients for the SNP main effects and their corresponding interactions with the treatment factors. Model convergence diagnostics in terms of PSRF plots and trace plots are shown in Figure A2 and Figure A3 in the Appendix A, respectively.
Among the selected SNPs, rs718100, located in the ILVBL gene region, has previously been investigated in aspirin-exacerbated respiratory disease (AERD) among asthma patients [54]. In addition, rs13339155 is located near the WWOX gene region on chromosome 16q23.1. Previous studies have suggested that WWOX may play an important role in tumor suppression and lung cancer development [55]. Although further biological validation is needed, these findings suggest that the proposed method is capable of identifying potentially meaningful genetic markers and G×E interactions in longitudinal asthma studies.

6. Discussion

In this paper, we introduce the R package mixedBayes, which implements the longitudinal gene–environment interaction analyses proposed in Fan et al. (2025) [15] and Li et al. (2025) [16]. Our limited software review, together with Table 1, indicates that while numerous R packages have been developed for variable selection and for low-dimensional longitudinal analysis separately (under both frequentist and Bayesian frameworks), relatively few can address these two tasks simultaneously. In particular, due to the challenges of robust inference in high-dimensional settings [14], mixedBayes is among the few R packages that enable robust statistical inference for high-dimensional longitudinal studies.
Nevertheless, mixedBayes has certain limitations. It currently assumes that all subjects have the same number of repeated measurements and, therefore, cannot accommodate irregular observation schedules or missing data. Such limitations are partially due to the fact that the CAMP data analyzed in this paper, as well as the longitudinal lipid data analyzed in Fan et al. (2025) [15] and Li et al. (2025) [16], contain the same number of repeated measurements for all subjects and do not involve irregular or missing observations. The mixedBayes package can be readily extended to accommodate these characteristics when such real-world data become available to the authors. Moreover, only the response variable is measured longitudinally, while the genetic and environmental factors are assumed to be time-invariant. Future updates will aim to address these limitations. In addition, from a methodological perspective, the current version of mixedBayes focuses on linear G×E interactions, whereas substantial work has explored nonlinear interactions in cross-sectional settings [3]. Extensions to nonlinear gene–environment interactions are available in the R package Blend (version 0.1.2), which is publicly available on CRAN at https://CRAN.R-project.org/package=Blend (accessed on 1 May 2026). Furthermore, Bayesian inference may also be conducted using approximate Bayesian computation methods rather than MCMC, such as Wang et al. (2023) [56], to quantify the uncertainty of important main and interaction effects.

Author Contributions

Conceptualization, K.F., X.L. and C.W.; Methodology, K.F., X.L. and C.W.; Software, K.F., X.L., S.D. and C.W.; Validation, K.F., X.L., S.D. and B.O.; Formal analysis, K.F., X.L., S.D. and B.O.; Investigation, K.F., X.L., S.D. and B.O.; Data curation, S.D., B.O. and C.W.; Writing—original draft, K.F., X.L. and C.W.; Writing—review & editing, all authors; Visualization, K.F. and B.O.; Supervision, C.W.; Project administration, C.W.; Funding acquisition, C.W. All authors have read and agreed to the published version of the manuscript.

Funding

This work was partially supported by an Innovative Research Award from the Johnson Cancer Research Center at Kansas State University.

Data Availability Statement

The data analyzed in the case study require authorized access and, therefore, cannot be publicly shared or included in the manuscript. Access requests should be submitted to dbGaP (accession number phs000166.v2.p1) at https://www.ncbi.nlm.nih.gov/projects/gap/cgi-bin/study.cgi?study_id=phs000166.v2.p1 (accessed on 23 April 2026). The R code examples presented in Section 4.1 and Section 4.2 are also publicly available at https://doi.org/10.6084/m9.figshare.32395461 (accessed on 25 May 2026).

Acknowledgments

We thank the editor and anonymous reviewers for their careful review and constructive comments, leading to significant improvement in this article.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

ANOVAAnalysis of Variance
ALDAsymmetric Laplace distribution
CAMPChildhood Asthma Management Program
CRANComprehensive R Archive Network
ESSEffective sample size
FDRFalse discovery rate
FPFalse positive
GEEGeneralized estimating
GLMMGeneralized linear mixed model
LASSOLeast absolute shrinkage and selection operator
MADMean absolute deviation
MAEMean absolute error
MCMCMarkov chain Monte Carlo
MPMMedian probability model
MSEMean squared error
PIPPosterior inclusion probability
PGEEPenalized generalized estimating
PSRFPotential scale reduction factor
TMADTotal mean absolute deviation
TPTrue positive
QIFQuadratic Inference Function
SNPSingle-nucleotide polymorphism

Appendix A

Figure A1. Trace plots for representative nonzero coefficients (4 G main effects and 12 G×E interaction effects) under the model described in Section 4.1 at the 50% quantile level after discarding the first 5000 iterations as burn-in.
Figure A1. Trace plots for representative nonzero coefficients (4 G main effects and 12 G×E interaction effects) under the model described in Section 4.1 at the 50% quantile level after discarding the first 5000 iterations as burn-in.
Entropy 28 00649 g0a1
Figure A2. Potential scale reduction factor (PSRF) across iterations for selected SNPs (3 SNP main effects and 6 SNP×E interaction effects) from the case study at the 50% quantile level. Black line: The PSRF. Red line: The threshold of 1.1.
Figure A2. Potential scale reduction factor (PSRF) across iterations for selected SNPs (3 SNP main effects and 6 SNP×E interaction effects) from the case study at the 50% quantile level. Black line: The PSRF. Red line: The threshold of 1.1.
Entropy 28 00649 g0a2
Figure A3. Trace plots for selected SNPs (3 SNP main effects and 6 SNP×E interaction effects) in the case study at the 50% quantile level after discarding the first 5000 iterations as burn-in.
Figure A3. Trace plots for selected SNPs (3 SNP main effects and 6 SNP×E interaction effects) in the case study at the 50% quantile level after discarding the first 5000 iterations as burn-in.
Entropy 28 00649 g0a3

References

  1. Fan, R.; Albert, P.S.; Schisterman, E.F. A discussion of gene-gene and gene-environment interactions and longitudinal genetic analysis of complex traits. Stat. Med. 2012, 31, 2565. [Google Scholar] [CrossRef]
  2. Herrera-Luis, E.; Benke, K.; Volk, H.; Ladd-Acosta, C.; Wojcik, G.L. Gene–environment interactions in human health. Nat. Rev. Genet. 2024, 25, 768–784. [Google Scholar] [CrossRef]
  3. Zhou, F.; Ren, J.; Lu, X.; Ma, S.; Wu, C. Gene–environment interaction: A variable selection perspective. Epistasis Methods Protoc. 2021, 2212, 191–223. [Google Scholar]
  4. Wu, C.; Shi, X.; Cui, Y.; Ma, S. A penalized robust semiparametric approach for gene–environment interactions. Stat. Med. 2015, 34, 4016–4030. [Google Scholar] [CrossRef] [PubMed]
  5. Chai, H.; Zhang, Q.; Jiang, Y.; Wang, G.; Zhang, S.; Ahmed, S.E.; Ma, S. Identifying gene-environment interactions for prognosis using a robust approach. Econom. Stat. 2017, 4, 105–120. [Google Scholar] [CrossRef]
  6. Wu, C.; Jiang, Y.; Ren, J.; Cui, Y.; Ma, S. Dissecting gene-environment interactions: A penalized robust approach accounting for hierarchical structures. Stat. Med. 2018, 37, 437–456. [Google Scholar] [CrossRef] [PubMed]
  7. Zhang, Q.; Chai, H.; Liang, W.; Ma, S. Robust identification of gene-environment interactions under high-dimensional accelerated failure time models. In Proceedings of the International Forum on Financial Mathematics and Financial Technology; Springer: Berlin/Heidelberg, Germany, 2021; pp. 37–63. [Google Scholar]
  8. Wang, L.; Zhou, J.; Qu, A. Penalized generalized estimating equations for high-dimensional longitudinal data analysis. Biometrics 2012, 68, 353–360. [Google Scholar] [CrossRef]
  9. Li, S.; Cai, T.T.; Li, H. Inference for high-dimensional linear mixed-effects models: A quasi-likelihood approach. J. Am. Stat. Assoc. 2022, 117, 1835–1846. [Google Scholar] [CrossRef]
  10. Leon, S.; Wu, T.T. Comparison of longitudinal trajectories using a high-dimensional partial linear semiparametric mixed-effects model. J. Am. Stat. Assoc. 2025, 120, 2288–2301. [Google Scholar] [CrossRef]
  11. Fitzmaurice, G.M.; Laird, N.M.; Ware, J.H. Applied Longitudinal Analysis; John Wiley & Sons: Hoboken, NJ, USA, 2012. [Google Scholar]
  12. Zhang, C.H.; Zhang, S.S. Confidence intervals for low dimensional parameters in high dimensional linear models. J. R. Stat. Soc. Ser. Stat. Methodol. 2014, 76, 217–242. [Google Scholar] [CrossRef]
  13. Javanmard, A.; Montanari, A. Confidence intervals and hypothesis testing for high-dimensional regression. J. Mach. Learn. Res. 2014, 15, 2869–2909. [Google Scholar]
  14. Fan, K.; Subedi, S.; Yang, G.; Lu, X.; Ren, J.; Wu, C. Is seeing believing? A practitioner’s perspective on high-dimensional statistical inference in cancer genomics studies. Entropy 2024, 26, 794. [Google Scholar] [CrossRef]
  15. Fan, K.; Jiang, Y.; Ma, S.; Wang, W.; Wu, C. Robust sparse Bayesian regression for longitudinal gene–environment interactions. J. R. Stat. Soc. Ser. C Appl. Stat. 2025, 74, 1372–1394. [Google Scholar] [CrossRef] [PubMed]
  16. Li, X.; Fan, K.; Wu, C. Prioritizing Longitudinal Gene–Environment Interactions Using an FDR-Assisted Robust Bayesian Linear Mixed Model. Algorithms 2025, 18, 728. [Google Scholar] [CrossRef]
  17. Liang, K.Y.; Zeger, S.L. Longitudinal data analysis using generalized linear models. Biometrika 1986, 73, 13–22. [Google Scholar] [CrossRef]
  18. Zhou, F.; Lu, X.; Ren, J.; Fan, K.; Ma, S.; Wu, C. Sparse group variable selection for gene–environment interactions in the longitudinal study. Genet. Epidemiol. 2022, 46, 317–340. [Google Scholar] [CrossRef]
  19. Zhou, F.; Liu, Y.; Ren, J.; Wang, W.; Wu, C. Springer: An R package for bi-level variable selection of high-dimensional longitudinal data. Front. Genet. 2023, 14, 1088223. [Google Scholar] [CrossRef]
  20. Zhou, F.; Ren, J.; Li, G.; Jiang, Y.; Li, X.; Wang, W.; Wu, C. Penalized Variable Selection for Lipid–Environment interactions in a longitudinal lipidomics study. Genes 2019, 10, 1002. [Google Scholar] [CrossRef]
  21. Zhou, F.; Ren, J.; Liu, Y.; Li, X.; Wang, W.; Wu, C. Interep: An R package for high-dimensional interaction analysis of the repeated measurement data. Genes 2022, 13, 544. [Google Scholar] [CrossRef]
  22. Qu, A.; Lindsay, B.G.; Li, B. Improving generalised estimating equations using quadratic inference functions. Biometrika 2000, 87, 823–836. [Google Scholar] [CrossRef]
  23. Hu, J.; Szymczak, S. A review on longitudinal data analysis with random forest. Brief. Bioinform. 2023, 24, bbad002. [Google Scholar] [CrossRef]
  24. Barbieri, M.M.; Berger, J.O. Optimal predictive model selection. Ann. Stat. 2004, 32, 870–897. [Google Scholar] [CrossRef]
  25. Carreño, E.J.C.; Cuervo, E.C. Bayeslongitudinal: Adjust Longitudinal Regression Models Using Bayesian Methodology, R Package Version 0.1.0. 2017. Available online: https://cran.r-project.org/web/packages/bayeslongitudinal/bayeslongitudinal.pdf (accessed on 22 April 2026).
  26. Zu, T.; Green, B.; Yu, Y. The R Package geeVerse for Ultra-High-Dimensional Heterogeneous Data Analysis with Generalized Estimating Equations. J. Data Sci. 2025, 1–20. [Google Scholar] [CrossRef]
  27. Inan, G.; Wang, L. PGEE: An R package for analysis of longitudinal data with high-dimensional covariates. R J. 2017, 9, 393–402. [Google Scholar] [CrossRef]
  28. Deshpande, V.; Dey, D.K.; Schifano, E.D. Variable selection for correlated bivariate mixed outcomes using penalized generalized estimating equations. Stat. Its Interface 2019, 12, 265–274. [Google Scholar] [CrossRef]
  29. Li, J.; Lu, Q.; Wen, Y. Multi-kernel linear mixed model with adaptive lasso for prediction analysis on high-dimensional multi-omics data. Bioinformatics 2020, 36, 1785–1794. [Google Scholar] [CrossRef]
  30. Groll, A.; Tutz, G. Variable selection for generalized linear mixed models by L 1-penalized estimation. Stat. Comput. 2014, 24, 137–154. [Google Scholar] [CrossRef]
  31. Sela, R.J.; Simonoff, J.S. RE-EM trees: A data mining approach for longitudinal and clustered data. Mach. Learn. 2012, 86, 169–207. [Google Scholar] [CrossRef]
  32. Segal, M.; Xiao, Y. Multivariate random forests. Wiley Interdiscip. Rev. Data Min. Knowl. Discov. 2011, 1, 80–87. [Google Scholar] [CrossRef]
  33. Rahman, R.; Otridge, J.; Pal, R. IntegratedMRF: Random forest-based framework for integrating prediction from different data types. Bioinformatics 2017, 33, 1407–1410. [Google Scholar] [CrossRef]
  34. Chen, C.Y.; Löber, U.; Forslund, S.K. LongDat: An R package for covariate-sensitive longitudinal analysis of high-dimensional data. Bioinform. Adv. 2023, 3, vbad063. [Google Scholar] [CrossRef]
  35. Capitaine, L.; Genuer, R.; Thiébaut, R. Random forests for high-dimensional longitudinal data. Stat. Methods Med. Res. 2021, 30, 166–184. [Google Scholar] [CrossRef]
  36. Hajjem, A.; Bellavance, F.; Larocque, D. Mixed-effects random forest for clustered data. J. Stat. Comput. Simul. 2014, 84, 1313–1328. [Google Scholar] [CrossRef]
  37. Yu, K.; Moyeed, R.A. Bayesian quantile regression. Stat. Probab. Lett. 2001, 54, 437–447. [Google Scholar] [CrossRef]
  38. Yu, K.; Zhang, J. A three-parameter asymmetric Laplace distribution and its extension. Commun. Stat. Theory Methods 2005, 34, 1867–1879. [Google Scholar] [CrossRef]
  39. Dao, M.; Wang, M.; Ghosh, S.; Ye, K. Bayesian variable selection and estimation in quantile regression using a quantile-specific prior. Comput. Stat. 2022, 37, 1339–1368. [Google Scholar] [CrossRef]
  40. De, S.; Ghosh, J. Horseshoe Prior for Bayesian Linear Regression with Hyperbolic Errors. Stat. Appl. 2024, 22, 199–209. [Google Scholar]
  41. De, S.; Ghosh, J. Robust Bayesian model averaging for linear regression models with heavy-tailed errors. J. Appl. Stat. 2026, 53, 304–330. [Google Scholar] [CrossRef] [PubMed]
  42. Barbieri, M.M.; Berger, J.O.; George, E.I.; Ročková, V. The median probability model and correlated variables. Bayesian Anal. 2021, 16, 1085–1112. [Google Scholar] [CrossRef]
  43. Bien, J.; Taylor, J.; Tibshirani, R. A lasso for hierarchical interactions. Ann. Stat. 2013, 41, 1111. [Google Scholar] [CrossRef]
  44. Zhang, L.; Baladandayuthapani, V.; Mallick, B.K.; Manyam, G.C.; Thompson, P.A.; Bondy, M.L.; Do, K.A. Bayesian hierarchical structured variable selection methods with application to molecular inversion probe studies in breast cancer. J. R. Stat. Soc. Ser. Appl. Stat. 2014, 63, 595–620. [Google Scholar] [CrossRef]
  45. Müller, P.; Parmigiani, G.; Rice, K. FDR and Bayesian Multiple Comparisons Rules. In Bayesian Statistics 8: Proceedings of the Eighth Valencia International Meeting; Oxford University Press: Oxford, UK, 2007; pp. 359–380. [Google Scholar] [CrossRef]
  46. Morris, J.S.; Brown, P.J.; Herrick, R.C.; Baggerly, K.A.; Coombes, K.R. Bayesian analysis of mass spectrometry proteomic data using wavelet-based functional mixed models. Biometrics 2008, 64, 479–489. [Google Scholar] [CrossRef]
  47. Gelman, A.; Rubin, D.B. Inference from iterative simulation using multiple sequences. Stat. Sci. 1992, 7, 457–472. [Google Scholar] [CrossRef]
  48. Brooks, S.P.; Gelman, A. General methods for monitoring convergence of iterative simulations. J. Comput. Graph. Stat. 1998, 7, 434–455. [Google Scholar] [CrossRef]
  49. Gelman, A.; Carlin, J.B.; Stern, H.S.; Rubin, D.B. Bayesian Data Analysis; Chapman and Hall/CRC: Boca Raton, FL, USA, 1995. [Google Scholar]
  50. Plummer, M.; Best, N.; Cowles, K.; Vines, K. CODA: Convergence diagnosis and output analysis for MCMC. R News 2006, 6, 7–11. [Google Scholar]
  51. Childhood Asthma Management Program Research Group and Others. The childhood asthma management program (CAMP): Design, rationale, and methods. Control. Clin. Trials 1999, 20, 91–120.
  52. Childhood Asthma Management Program Research Group. Long-term effects of budesonide or nedocromil in children with asthma. N. Engl. J. Med. 2000, 343, 1054–1063. [Google Scholar]
  53. Covar, R.A.; Fuhlbrigge, A.L.; Williams, P.; Kelly, H.W.; Childhood Asthma Management Program Research Group. The Childhood Asthma Management Program (CAMP): Contributions to the understanding of therapy and the natural history of childhood asthma. Curr. Respir. Care Rep. 2012, 1, 243–250. [Google Scholar] [CrossRef]
  54. Chang, H.S.; Park, J.S.; Lee, H.S.; Lyu, J.; Son, J.H.; Choi, I.S.; Shin, H.D.; Park, C.S. Association analysis of ILVBL gene polymorphisms with aspirin-exacerbated respiratory disease in asthma. BMC Pulm. Med. 2017, 17, 210. [Google Scholar] [CrossRef]
  55. Yang, J.; Cogdell, D.; Yang, D.; Hu, L.; Li, H.; Zheng, H.; Du, X.; Pang, Y.; Trent, J.; Chen, K.; et al. Deletion of the WWOX gene and frequent loss of its protein expression in human osteosarcoma. Cancer Lett. 2010, 291, 31–38. [Google Scholar] [CrossRef]
  56. Wang, C.; Yang, L.; Xie, M.; Valdebenito, M.; Beer, M. Bayesian maximum entropy method for stochastic model updating using measurement data and statistical information. Mech. Syst. Signal Process. 2023, 188, 110012. [Google Scholar] [CrossRef]
Figure 1. Potential scale reduction factor (PSRF) across iterations for nonzero coefficients (4 G main effects and 18 G×E interaction effects) in a simulation at the 50% quantile level under the model described in Section 4.1. Black line: The PSRF. Red line: The threshold of 1.1.
Figure 1. Potential scale reduction factor (PSRF) across iterations for nonzero coefficients (4 G main effects and 18 G×E interaction effects) in a simulation at the 50% quantile level under the model described in Section 4.1. Black line: The PSRF. Red line: The threshold of 1.1.
Entropy 28 00649 g001
Table 2. Computational time based on the R example in Section 4.1 at the 50% quantile. p: number of genetic factors. Time: CPU time (in seconds) for 10,000 MCMC iterations. The total number of regression coefficients to be estimated is q p + p + 1 , where q is the number of environmental factors. In this study, q = 3 .
Table 2. Computational time based on the R example in Section 4.1 at the 50% quantile. p: number of genetic factors. Time: CPU time (in seconds) for 10,000 MCMC iterations. The total number of regression coefficients to be estimated is q p + p + 1 , where q is the number of environmental factors. In this study, q = 3 .
n = 200n = 500n = 800
p = 100 6.312 p = 400 55.912 p = 600 144.246
p = 200 10.968 p = 500 66.852 p = 800 177.652
p = 300 15.704 p = 600 79.193 p = 1000 416.022
Table 3. Convergence diagnostics for the model described in Section 4.1 based on four parallel MCMC chains. Effective sample size (ESS) is reported as mean (SD) for nonzero, zero, and all coefficients after discarding the first 5000 iterations as burn-in.
Table 3. Convergence diagnostics for the model described in Section 4.1 based on four parallel MCMC chains. Effective sample size (ESS) is reported as mean (SD) for nonzero, zero, and all coefficients after discarding the first 5000 iterations as burn-in.
Parameter GroupNonzero CoefficientsZero CoefficientsAll Coefficients
Main effects1089.07 (888.10)9175.08 (4426.94)8851.64 (4622.33)
Interaction effects1982.02 (724.67)2417.19 (3059.52)2391.08 (2972.83)
Table 4. Estimated regression coefficients for the identified SNP main effects and SNP-by-treatment interactions under the model described in Section 4.1.
Table 4. Estimated regression coefficients for the identified SNP main effects and SNP-by-treatment interactions under the model described in Section 4.1.
SNPSNP Main EffectBudesonide × SNPNedocromil × SNP
rs115781524.209−5.709−6.800
rs71550890.126−0.066
rs76306280.303−0.127
rs9923790.307−0.052
rs16675400.061
rs104037080.0440.106
rs2436930.152−0.160
rs175912114.206−5.956−6.952
rs6849562−0.604−0.101
rs9258340.0590.241
rs13339155−3.695−5.242−4.840
rs13603670.075
rs4476000.064
rs15393880.0920.3080.106
rs13593586.1961.1316.052
rs76306920.3270.081
rs65054130.089
rs128903520.365−0.016
rs7340644−0.077
rs8673220.165−0.041
rs95221680.1080.6320.018
rs121491300.170
rs718100−1.7060.306−0.238
rs48536020.0000.4420.161
rs102470610.1570.5290.346
rs37653060.0770.4070.118
rs7773550.284−0.088
rs14789711.748
rs69680390.084
rs125480550.326−0.079
rs65754211.033−0.072
rs108465610.030
rs75715286.2761.8296.190
rs2878840.0290.413−0.151
rs111283750.015
rs101112890.016−0.107
rs127088250.053
rs78286523.7875.9185.012
SNPs are included if either their main effects or corresponding treatment interaction effects are selected via the median probability model criterion, consistent with the weak hierarchy principle of the fitted model. Estimates are rounded to three decimal places; “–” indicates that the corresponding main or interaction effect is not selected.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Fan, K.; Li, X.; Devnath, S.; Olson, B.; Wu, C. MixedBayes: An R Package for Longitudinal Gene–Environment Interaction Analysis Using Robust Sparse Bayesian Mixed Models. Entropy 2026, 28, 649. https://doi.org/10.3390/e28060649

AMA Style

Fan K, Li X, Devnath S, Olson B, Wu C. MixedBayes: An R Package for Longitudinal Gene–Environment Interaction Analysis Using Robust Sparse Bayesian Mixed Models. Entropy. 2026; 28(6):649. https://doi.org/10.3390/e28060649

Chicago/Turabian Style

Fan, Kun, Xiaoxi Li, Shejuty Devnath, Brock Olson, and Cen Wu. 2026. "MixedBayes: An R Package for Longitudinal Gene–Environment Interaction Analysis Using Robust Sparse Bayesian Mixed Models" Entropy 28, no. 6: 649. https://doi.org/10.3390/e28060649

APA Style

Fan, K., Li, X., Devnath, S., Olson, B., & Wu, C. (2026). MixedBayes: An R Package for Longitudinal Gene–Environment Interaction Analysis Using Robust Sparse Bayesian Mixed Models. Entropy, 28(6), 649. https://doi.org/10.3390/e28060649

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop