Skip to content

BMA

Bayesian Model Averaging

v3.18.20 · Jan 10, 2025 · GPL (>= 2)

Description

Package for Bayesian model averaging and variable selection for linear models, generalized linear models and survival models (cox regression).

Downloads

2.9K

Last 30 days

2322nd

6.8K

Last 90 days

6.8K

Last year

Trend: -27.9% (30d vs prior 30d)

CRAN Check Status

1 ERROR
13 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang ERROR
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK
Check details (14 non-OK)
ERROR r-devel-linux-x86_64-debian-clang

examples

Running examples in ‘BMA-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: iBMA
> ### Title: Iterated Bayesian Model Averaging variable selection for
> ###   generalized linear models, linear models or survival models.
> ### Aliases: iBMA iBMA.glm iBMA.bicreg iBMA.surv iBMA.glm.data.frame
> ###   iBMA.glm.matrix iBMA.glm.iBMA.intermediate.glm iBMA.bicreg.data.frame
> ###   iBMA.bicreg.matrix iBMA.bicreg.iBMA.intermediate.bicreg
> ###   iBMA.surv.data.frame iBMA.surv.matrix
> ###   iBMA.surv.iBMA.intermediate.surv
> ### Keywords: regression survival
> 
> ### ** Examples
> 
> 
> ## Not run: 
> ##D ############ iBMA.glm
> ##D library("MASS")
> ##D data(birthwt)
> ##D  y<- birthwt$lo
> ##D  x<- data.frame(birthwt[,-1])
> ##D  x$race<- as.factor(x$race)
> ##D  x$ht<- (x$ht>=1)+0
> ##D  x<- x[,-9]
> ##D  x$smoke <- as.factor(x$smoke)
> ##D  x$ptl<- as.factor(x$ptl)
> ##D  x$ht <- as.factor(x$ht)
> ##D  x$ui <- as.factor(x$ui)
> ##D 
> ##D ### add 41 columns of noise
> ##D noise<- matrix(rnorm(41*nrow(x)), ncol=41)
> ##D colnames(noise)<- paste('noise', 1:41, sep='')
> ##D x<- cbind(x, noise)
> ##D 
> ##D iBMA.glm.out<- iBMA.glm( x, y, glm.family="binomial", 
> ##D                          factor.type=FALSE, verbose = TRUE, 
> ##D                          thresProbne0 = 5 )
> ##D summary(iBMA.glm.out)
> ## End(Not run)
> 
> ## Not run: 
> ##D ################## iBMA.surv
> ##D library(survival)
> ##D data(cancer)
> ##D 
> ##D surv.t<- veteran$time
> ##D cens<- veteran$status
> ##D veteran$time<- NULL
> ##D veteran$status<- NULL
> ##D lvet<- nrow(veteran)
> ##D invlogit<- function(x) exp(x)/(1+exp(x))
> ##D # generate random noise, 34 uniform variables 
> ##D # and 10 factors each with 4 levels
> ##D X <- data.frame(matrix(runif(lvet*34), ncol=34), 
> ##D                matrix(letters[1:6][(rbinom(10*lvet, 3, .5))+1], 
> ##D                ncol = 10))
> ##D colnames(X) <- c(paste("u",1:34, sep=""),paste("C",1:10, sep=""))
> ##D for(i in 35:44) X[,i] <- as.factor(X[,i])
> ##D veteran_plus_noise<- cbind(veteran, X)
> ##D 
> ##D 
> ##D test.iBMA.surv <- iBMA.surv(x = veteran_plus_noise, 
> ##D                             surv.t = surv.t, cens = cens, 
> ##D                             thresProbne0 = 5, maxNvar = 30, 
> ##D                             factor.type = TRUE, verbose = TRUE, 
> ##D                             nIter = 100)
> ##D 
> ##D test.iBMA.surv
> ##D summary(test.iBMA.surv)
> ## End(Not run)
> 
> ## Not run: 
> ##D ############ iBMA.bicreg ... degenerate example
> ##D library(MASS)
> ##D data(UScrime)
> ##D UScrime$M<- log(UScrime$M); UScrime$Ed<- log(UScrime$Ed); 
> ##D UScrime$Po1<- log(UScrime$Po1); UScrime$Po2<- log(UScrime$Po2); 
> ##D UScrime$LF<- log(UScrime$LF); UScrime$M.F<- log(UScrime$M.F)
> ##D UScrime$Pop<- log(UScrime$Pop); UScrime$NW<- log(UScrime$NW); 
> ##D UScrime$U1<- log(UScrime$U1); UScrime$U2<- log(UScrime$U2); 
> ##D UScrime$GDP<- log(UScrime$GDP); UScrime$Ineq<- log(UScrime$Ineq)
> ##D UScrime$Prob<- log(UScrime$Prob); UScrime$Time<- log(UScrime$Time) 
> ##D noise<- matrix(rnorm(35*nrow(UScrime)), ncol=35)
> ##D colnames(noise)<- paste('noise', 1:35, sep='')
> ##D UScrime_plus_noise<- cbind(UScrime, noise)
> ##D 
> ##D y<- UScrime_plus_noise$y
> ##D UScrime_plus_noise$y <- NULL
> ##D 
> ##D # run 2 iterations and examine results
> ##D iBMA.bicreg.crime <- iBMA.bicreg( x = UScrime_plus_noise, 
> ##D  Y = y, thresProbne0 = 5, verbose = TRUE, maxNvar = 30, nIter = 2)
> ##D summary(iBMA.bicreg.crime)
> ##D orderplot(iBMA.bicreg.crime)
> ## End(Not run)
> 
> ## Not run: 
> ##D # run from current state until completion
> ##D iBMA.bicreg.crime <- iBMA.bicreg( iBMA.bicreg.crime, nIter = 200)
> ##D summary(iBMA.bicreg.crime)
> ##D orderplot(iBMA.bicreg.crime)
> ## End(Not run)
> 
> set.seed(0)
> x <- matrix( rnorm(50*30), 50, 30)
> lp <- apply( x[,1:5], 1, sum)
> iBMA.bicreg.ex <- iBMA.bicreg( x = x,  Y = lp, thresProbne0 = 5, maxNvar = 20)
> 
> explp <- exp(lp)
> prob <- explp/(1+explp)
> y=rbinom(n=length(prob),prob=prob,size=1)
> iBMA.glm.ex <- iBMA.glm( x = x, Y = y, glm.family = "binomial",
+                          factor.type = FALSE, thresProbne0 = 5, maxNvar = 20)

ERROR(s) during compilation: source code errors or compiler configuration errors!
make cmd is
  make -f '/home/hornik/tmp/R.check/r-devel-clang/Work/build/etc/Makeconf' -f '/home/hornik/tmp/R.check/r-devel-clang/Work/build/share/make/shlib.mk' -f '/home/hornik/.R/Makevars-clang' SHLIB='file319a5320b5ac6e.so' OBJECTS='file319a5320b5ac6e.o'

make would use
make[1]: Entering directory '/home/hornik/tmp/scratch/RtmpPmKxDh'
clang-21 -std=gnu23 -I"/home/hornik/tmp/R.check/r-devel-clang/Work/build/include" -DNDEBUG -DR_NO_REMAP  -I/usr/local/include -D_FORTIFY_SOURCE=3   -fpic  -g -O3 -Wall -pedantic -c file319a5320b5ac6e.c -o file319a5320b5ac6e.o
if test  "zfile319a5320b5ac6e.o" != "z"; then \
  echo clang-21 -std=gnu23 -shared -L"/home/hornik/tmp/R.check/r-devel-clang/Work/build/lib" -Wl,-O1 -o file319a5320b5ac6e.so file319a5320b5ac6e.o    -L"/home/hornik/tmp/R.check/r-devel-clang/Work/build/lib" -lR; \
  clang-21 -std=gnu23 -shared -L"/home/hornik/tmp/R.check/r-devel-clang/Work/build/lib" -Wl,-O1 -o file319a5320b5ac6e.so file319a5320b5ac6e.o    -L"/home/hornik/tmp/R.check/r-devel-clang/Work/build/lib" -lR; \
fi
make[1]: Leaving directory '/home/hornik/tmp/scratch/RtmpPmKxDh'

Program source:
  1: #include <R.h>
  2: #include <Rdefines.h>
  3: #include <R_ext/Error.h>
  4: 
  5: 
  6: /* This is taken from envir.c in the R 2.15.1 source
  7: https://github.com/SurajGupta/r-source/blob/master/src/main/envir.c
  8: */
  9: #define FRAME_LOCK_MASK (1<<14)
 10: #define FRAME_IS_LOCKED(e) (ENVFLAGS(e) & FRAME_LOCK_MASK)
 11: #define UNLOCK_FRAME(e) SET_ENVFLAGS(e, ENVFLAGS(e) & (~ FRAME_LOCK_MASK))
 12: #define R_NO_REMAP
 13: 
 14: 
 15: SEXP file319a5320b5ac6e ( SEXP env ) {
 16: 
 17: if (TYPEOF(env) == NILSXP)
 18: Rf_error("use of NULL environment is defunct");
 19: if (TYPEOF(env) != ENVSXP)
 20: Rf_error("not an environment");
 21:  
 22: UNLOCK_FRAME(env);
 23:  
 24: // Return TRUE if unlocked; FALSE otherwise
 25: SEXP result = PROTECT( Rf_allocVector(LGLSXP, 1) );
 26: LOGICAL(result)[0] = FRAME_IS_LOCKED(env) == 0;
 27: UNPROTECT(1);
 28:  
 29: return result;
 30: 
 31:   Rf_warning("your C program does not return anything!");
 32:   return R_NilValue;
 33: }

Compilation ERROR, function(s)/method(s) not created!
Error in compileCode(f, code, language, verbose) : 
  from macro 'UNLOCK_FRAME'
   11 | #define UNLOCK_FRAME(e) SET_ENVFLAGS(e, ENVFLAGS(e) & (~ FRAME_LOCK_MASK))
      |                         ^~~~~~~~~~~~
file319a5320b5ac6e.c:22:1: error: use of undeclared identifier 'ENVFLAGS'
   22 | UNLOCK_FRAME(env);
      | ^~~~~~~~~~~~~~~~~
file319a5320b5ac6e.c:11:41: note: expanded from macro 'UNLOCK_FRAME'
   11 | #define UNLOCK_FRAME(e) SET_ENVFLAGS(e, ENVFLAGS(e) & (~ FRAME_LOCK_MASK))
      |                                         ^~~~~~~~
file319a5320b5ac6e.c:26:22: error: use of undeclared identifier 'ENVFLAGS'
   26 | LOGICAL(result)[0] = FRAME_IS_LOCKED(env) == 0;
      |                      ^~~~~~~~~~~~~~~~~~~~
file319a5320b5ac6e.c:10:29: note: expanded from macro 'FRAME_IS_LOCKED'
   10 | #define FRAME_IS_LOCKED(e) (ENVFLAGS(e) & FRAME_LOCK_MASK)
      |                             ^~~~~~~~
1 warning and 3 errors generated.
make[1]: *** [/home/hornik/tmp/R.check/r-devel-clang/Work/build/etc/Makeconf:190: file319a5320b5ac6e.o
Calls: iBMA.glm -> iBMA.glm.matrix -> cfunction -> compileCode
Execution halted
OK r-devel-linux-x86_64-debian-gcc

*


            
OK r-devel-linux-x86_64-fedora-clang

*


            
OK r-devel-linux-x86_64-fedora-gcc

*


            
OK r-devel-macos-arm64

*


            
OK r-devel-windows-x86_64

*


            
OK r-oldrel-macos-arm64

*


            
OK r-oldrel-macos-x86_64

*


            
OK r-oldrel-windows-x86_64

*


            
OK r-patched-linux-x86_64

*


            
OK r-release-linux-x86_64

*


            
OK r-release-macos-arm64

*


            
OK r-release-macos-x86_64

*


            
OK r-release-windows-x86_64

*


            

Check History

ERROR 13 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Mar 9, 2026
ERROR r-devel-linux-x86_64-debian-clang

examples

Running examples in ‘BMA-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: iBMA
> ### Title: Iterated Bayesian Model Averaging variable selection for
> ###   generalized linear models, linear models or survival models.
> ### Aliases: iBMA iBMA.glm iBMA.bicreg iBMA.surv iBMA.glm.data.frame
> ###   iBMA.glm.matrix iBMA.glm.iBMA.intermediate.glm iBMA.bicreg.data.frame
> ###   iBMA.bicreg.matrix iBMA.bicreg.iBMA.intermediate.bicreg

Reverse Dependencies (6)

depends

suggests

Dependency Network

Dependencies Reverse dependencies survival leaps robustbase inline rrcov BCEE mlogitBMA Ecfun clustvarsel maclogp mpower BMA

Version History

new 3.18.20 Mar 9, 2026