Learn R Programming

mixedBayes

Bayesian Longitudinal Regularized Quantile Mixed Model

With high-dimensional omics features, repeated measure ANOVA leads to longitudinal gene-environment interaction studies that have intra-cluster correlations, outlying observations and structured sparsity arising from the ANOVA design. In this package, we have developed robust sparse Bayesian mixed effect models tailored for the above studies (Fan et al. (2025)). An efficient Gibbs sampler has been developed to facilitate fast computation. The Markov chain Monte Carlo algorithms of the proposed and alternative methods are efficiently implemented in 'C++'. The development of this software package and the associated statistical methods have been partially supported by an Innovative Research Award from Johnson Cancer Research Center, Kansas State University.

How to install

  • To install from github, run these two lines of code in R
install.packages("devtools")
devtools::install_github("kunfa/mixedBayes")
  • Released versions of mixedBayes are available on CRAN (link), and can be installed within R via
install.packages("mixedBayes")

Examples

Example.1 (default method: robust sparse bi-level selection under random intercept -and- slope model)

library(mixedBayes)
data(data)

fit = mixedBayes(y,e,X,g,w,k,structure=c("bi-level"))
fit$coefficient
b = selection(fit,sparse=TRUE)
index = which(coeff!=0)
pos = which(b != 0)
tp = length(intersect(index, pos))
fp = length(pos) - tp
list(tp=tp, fp=fp)

Example.2 (alternative: robust sparse individual level selection under random intercept -and- slope model)

fit = mixedBayes(y,e,X,g,w,k,structure=c("individual"))
fit$coefficient
b = selection(fit,sparse=TRUE)
index = which(coeff!=0)
pos = which(b != 0)
tp = length(intersect(index, pos))
fp = length(pos) - tp
list(tp=tp, fp=fp)

Example.3 (alternative: non-robust sparse bi-level selection under random intercept -and- slope model)

fit = mixedBayes(y,e,X,g,w,k,robust=FALSE, structure=c("bi-level"))
fit$coefficient
b = selection(fit,sparse=TRUE)
index = which(coeff!=0)
pos = which(b != 0)
tp = length(intersect(index, pos))
fp = length(pos) - tp
list(tp=tp, fp=fp)

Example.4 (alternative: robust sparse bi-level selection under random intercept model)

fit = mixedBayes(y,e,X,g,w,k,slope=FALSE, structure=c("bi-level"))
fit$coefficient    
b = selection(fit,sparse=TRUE)
index = which(coeff!=0)
pos = which(b != 0)
tp = length(intersect(index, pos))
fp = length(pos) - tp
list(tp=tp, fp=fp)

Methods

This package provides implementation for methods proposed in

Copy Link

Version

Install

install.packages('mixedBayes')

Monthly Downloads

528

Version

0.1.11

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Kun Fan

Last Published

August 20th, 2025

Functions in mixedBayes (0.1.11)

data

simulated data for demonstrating the features of mixedBayes
selection

Variable selection for a mixedBayes object
mixedBayes

fit a Bayesian longitudinal regularized quantile mixed model
mixedBayes-package

Bayesian Longitudinal Regularized Quantile Mixed Model