Running ‘test_asis.R’ [4s/7s]
  Running ‘test_basics.R’ [3s/5s]
  Running ‘test_bayesqgcomp.R’ [4s/7s]
  Running ‘test_boot_ints.R’ [4s/7s]
  Running ‘test_bootchooser.R’ [7s/11s]
  Running ‘test_factor.R’ [3s/6s]
  Running ‘test_id.R’ [4s/7s]
  Running ‘test_mice.R’ [3s/4s]
  Running ‘test_numeric.R’ [7s/11s]
  Running ‘test_poisson.R’ [3s/4s]
  Running ‘test_splits.R’ [3s/7s]
  Running ‘test_weights.R’ [3s/4s]
Running the tests in ‘tests/test_bayesqgcomp.R’ failed.
Complete output:
  > cat("# bayesqgcomp test\n")
  # bayesqgcomp test
  > #devtools::install_github("alexpkeil1/qgcomp@dev")
  > library("qgcomp")
  > data("metals", package="qgcomp")
  > 
  > Xnm <- c(
  +   'arsenic','barium','cadmium','calcium','chromium','copper',
  +   'iron','lead','magnesium','manganese','mercury','selenium','silver',
  +   'sodium','zinc'
  + )
  > 
  > # continuous outcome, example with perfect collinearity
  > metals$cadmium2 = metals$cadmium
  > Xnm2 = c(Xnm, "cadmium2")
  > res = try(qc.fit <- qgcomp.noboot(y~.,dat=metals[,c(Xnm2, 'y')], family=gaussian()), silent=TRUE)
  Including all model terms as exposures of interest
  
  > stopifnot(class(res)=="try-error")
  > # error
  > 
  > res = try(qc.fit <- qgcomp.noboot(y~.,dat=metals[,c(Xnm2, 'y')], family=gaussian(), bayes=TRUE))
  Including all model terms as exposures of interest
  
  > stopifnot(inherits(res, "qgcompfit"))
  > 
  > # compare to results with colinear exposure removed
  > res = try(qc.fit2 <- qgcomp.noboot(y~.,dat=metals[,c(Xnm, 'y')], family=gaussian()))
  Including all model terms as exposures of interest
  
  > stopifnot(inherits(res, "qgcompfit"))
  > 
  > #hitting code coverage just to check
  > dat = qgcomp:::.dgm_quantized(N=100)
  > dat$y = as.numeric(dat$y>median(dat$y))
  > 
  > qgcomp(y~.,dat=dat, expnms=c("x1", "x2"), family="binomial", rr=FALSE)
  Scaled effect size (positive direction, sum of positive coefficients = 1.69)
      x1     x2 
  0.9397 0.0603 
  
  Scaled effect size (negative direction, sum of negative coefficients = 0)
  None
  
  Mixture log(OR) (Delta method CI):
  
              Estimate Std. Error Lower CI Upper CI Z value  Pr(>|z|)
  (Intercept) -2.60396    0.82830 -4.22741 -0.98051 -3.1437  0.001668
  psi1         1.68937    0.37878  0.94697  2.43177  4.4600 8.196e-06
  > 
  > res = try(qgcomp(y~x1+x2,dat=dat, expnms=c("x1", "x2"), family=NULL, rr=FALSE), silent=TRUE)
  NULL
  > stopifnot(inherits(res, "try-error"))
  > 
  > qgcomp(y~x1+x2 | x1+x2,dat=dat, expnms=c("x1", "x2"), family="poisson")
  Prob(Y ~ count):
  Scaled effect size (positive direction, sum of positive coefficients = 0.587)
     x1    x2 
  0.887 0.113 
  
  Scaled effect size (negative direction, sum of negative coefficients = 0)
  None
  
  Prob(Y ~ zero/count):
  Scaled effect size (positive direction, sum of positive coefficients = 9.09)
  x2 
   1 
  
  Scaled effect size (negative direction, sum of negative coefficients = -26)
  x1 
   1 
  
  Mixture log(OR/RR) (Delta method CI):
  
  Prob(Y ~ count):
              Estimate Std. Error Lower CI Upper CI Z value  Pr(>|z|)
  (Intercept) -1.69156    0.43896 -2.55190 -0.83123 -3.8536 0.0001164
  psi1         0.58724    0.19982  0.19559  0.97888  2.9388 0.0032953
  Prob(Y ~ zero):
              Estimate Std. Error Lower CI Upper CI Z value Pr(>|z|)
  (Intercept)   -9.920     59.692  -126.92   107.08 -0.1662    0.868
  psi1         -16.886    111.873  -236.15   202.38 -0.1509    0.880
  > 
  > res = try(qgcomp(y~x1+x2 | x1+x2 +I(x2^2), B=2,dat=dat, expnms=c("x1", "x2"), bayes=TRUE, family="poisson"), silent=TRUE)
  > stopifnot(inherits(res, "try-error"))
  > 
  > 
  > ft = qgcomp(y~x1+x2 + I(x2^2), B=2,dat=dat, expnms=c("x1", "x2"), bayes=TRUE, family="poisson")
  > pp = msm.predict(ft)
  > ft = qgcomp(y~x1+x2,dat=dat, expnms=c("x1", "x2"), bayes=TRUE, family="poisson")
  > res = try(msm.predict(ft), silent = TRUE)
  > stopifnot(inherits(res, "try-error"))
  > 
  > 
  > ft = qgcomp(y~x1+x2 + I(x2^2), B=2, q=NULL,dat=dat, expnms=c("x1", "x2"), bayes=TRUE, family=binomial())
  
  Note: using all possible values of exposure as the
                intervention values
  
  > summary(ft)
  Mixture log(RR) (bootstrap CI):
  
  $coefficients
                Estimate Std. Error   Lower CI   Upper CI   Z value Pr(>|z|)
  (Intercept) -1.7716289 0.10022155 -1.9680595 -1.5751983 -17.67713        0
  psi1         0.5686187 0.02038669  0.5286615  0.6085759  27.89167        0
  
  > qc.fit2 <- qgcomp.boot(y~.,expnms = Xnm, dat=metals[,c(Xnm, 'y')],B=2, q=NULL, family=gaussian())
  
  Note: using quantiles of all exposures combined in order to set
            proposed intervention values for overall effect (25th, 50th, 75th %ile)
          You can ensure this is valid by scaling all variables in expnms to have similar ranges.
  Error in glm.fit(x = numeric(0), y = numeric(0), weights = numeric(0),  : 
    object 'fit' not found
  Calls: qgcomp.boot -> lapply -> FUN -> msm.fit
  Execution halted