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

> ### Name: blrm_exnex
> ### Title: Bayesian Logistic Regression Model for N-compounds with EXNEX
> ### Aliases: blrm_exnex print.blrmfit
> 
> ### ** Examples
> 
> ## Setting up dummy sampling for fast execution of example
> ## Please use 4 chains and 100x more warmup & iter in practice
> .user_mc_options <- options(OncoBayes2.MC.warmup=10, OncoBayes2.MC.iter=20, OncoBayes2.MC.chains=1)
> 
> # fit an example model. See documentation for "combo3" example
> example_model("combo3")
Runningcombo3example:

 ## example combo3

 library(RBesT)
 library(abind)

 dref <- c(500, 500, 1000)
 num_comp <- 3
 num_inter <- choose(3,2) + 1
 num_strata <- nlevels(hist_combo3$stratum)
 num_groups <- nlevels(hist_combo3$group_id)

 blrmfit <- blrm_exnex(cbind(Ntox, Npat-Ntox) ~
                           1 + I(log(DosesAdm1/dref[1])) |
                           1 + I(log(DosesAdm2/dref[2])) |
                           1 + I(log(DosesAdm3/dref[3])) |
                           0
                       + I(DosesAdm1/dref[1] * DosesAdm2/dref[2])
                       + I(DosesAdm1/dref[1] * DosesAdm3/dref[3])
                       + I(DosesAdm2/dref[2] * DosesAdm3/dref[3])
                       + I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]) |
                       stratum/group_id,
                       data=hist_combo3,
                       prior_EX_mu_mean_comp=matrix(c(logit(1/3), 0), nrow=num_comp, ncol=2, TRUE),
                       prior_EX_mu_sd_comp=matrix(c(2, 1), nrow=num_comp, ncol=2, TRUE),
           prior_EX_tau_mean_comp=abind(matrix(log(  c(0.25, 0.125)), nrow=num_comp, ncol=2, TRUE),
                                        matrix(log(2*c(0.25, 0.125)), nrow=num_comp, ncol=2, TRUE),
                                        along=0),
                       prior_EX_tau_sd_comp=abind(matrix(log(4)/1.96, nrow=num_comp, ncol=2, TRUE),
                                                  matrix(log(4)/1.96, nrow=num_comp, ncol=2, TRUE),
                                                  along=0),
                       prior_EX_mu_mean_inter=rep(0, num_inter),
                       prior_EX_mu_sd_inter=rep(sqrt(2)/2, num_inter),
                       prior_EX_tau_mean_inter=matrix(log(0.25)  , nrow=num_strata, ncol=num_inter),
                       prior_EX_tau_sd_inter=matrix(log(2)/1.96, nrow=num_strata, ncol=num_inter),
                       prior_EX_prob_comp=matrix(0.9, nrow=num_groups, ncol=num_comp),
                       prior_EX_prob_inter=matrix(0.9, nrow=num_groups, ncol=num_inter),
                       ## by default EXNEX is on for components and off for all interactions
                       prior_tau_dist=1,
                       prior_PD=FALSE
                       )

This is RBesT version 1.5.3
Warning: The largest R-hat is 2.12, indicating chains have not mixed.
Running the chains for more iterations may help. See
http://mc-stan.org/misc/warnings.html#r-hat
Warning: Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.
Running the chains for more iterations may help. See
http://mc-stan.org/misc/warnings.html#bulk-ess
Warning: Tail Effective Samples Size (ESS) is too low, indicating posterior variances and tail quantiles may be unreliable.
Running the chains for more iterations may help. See
http://mc-stan.org/misc/warnings.html#tail-ess
> 
> # print a summary of the prior
> prior_summary(blrmfit, digits = 3)
Bayesian Logistic Regression Model with EXchangeability-NonEXchangeability

Mixture configuration
---------------------
EXNEX components : 3 
component
I(log(DosesAdm1/dref[1])) I(log(DosesAdm2/dref[2])) I(log(DosesAdm3/dref[3])) 
                        1                         1                         1 

EXNEX interactions: 0 
interaction
                    I(DosesAdm1/dref[1] * DosesAdm2/dref[2]) 
                                                           0 
                    I(DosesAdm1/dref[1] * DosesAdm3/dref[3]) 
                                                           0 
                    I(DosesAdm2/dref[2] * DosesAdm3/dref[3]) 
                                                           0 
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]) 
                                                           0 

Prior probability for exchangeability per group
            component
group        I(log(DosesAdm1/dref[1])) I(log(DosesAdm2/dref[2]))
  Combo                            0.9                       0.9
  HistAgent1                       0.9                       0.9
  HistAgent2                       0.9                       0.9
            component
group        I(log(DosesAdm3/dref[3]))
  Combo                            0.9
  HistAgent1                       0.9
  HistAgent2                       0.9

            interaction
group        I(DosesAdm1/dref[1] * DosesAdm2/dref[2])
  Combo                                             1
  HistAgent1                                        1
  HistAgent2                                        1
            interaction
group        I(DosesAdm1/dref[1] * DosesAdm3/dref[3])
  Combo                                             1
  HistAgent1                                        1
  HistAgent2                                        1
            interaction
group        I(DosesAdm2/dref[2] * DosesAdm3/dref[3])
  Combo                                             1
  HistAgent1                                        1
  HistAgent2                                        1
            interaction
group        I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])
  Combo                                                                 1
  HistAgent1                                                            1
  HistAgent2                                                            1

EXchangable hyperparameter priors
---------------------------------
Component parameters
Mean mu_log_beta
                          coefficient intercept        log_slope       
                          prior            mean     sd      mean     sd
component                                                              
I(log(DosesAdm1/dref[1]))                -0.693  2.000     0.000  1.000
I(log(DosesAdm2/dref[2]))                -0.693  2.000     0.000  1.000
I(log(DosesAdm3/dref[3]))                -0.693  2.000     0.000  1.000

Heterogeneity tau_log_beta (log-normal)
                                  coefficient intercept        log_slope       
                                  prior            mean     sd      mean     sd
stratum component                                                              
BID     I(log(DosesAdm1/dref[1]))                -1.386  0.707    -2.079  0.707
        I(log(DosesAdm2/dref[2]))                -1.386  0.707    -2.079  0.707
        I(log(DosesAdm3/dref[3]))                -1.386  0.707    -2.079  0.707
QD      I(log(DosesAdm1/dref[1]))                -0.693  0.707    -1.386  0.707
        I(log(DosesAdm2/dref[2]))                -0.693  0.707    -1.386  0.707
        I(log(DosesAdm3/dref[3]))                -0.693  0.707    -1.386  0.707

Correlation LKJ
component
I(log(DosesAdm1/dref[1])) I(log(DosesAdm2/dref[2])) I(log(DosesAdm3/dref[3])) 
                        1                         1                         1 

Interaction parameters
Mean mu_eta
                                                             prior  mean    sd
interaction                                                                   
I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                           0.000 0.707
I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                           0.000 0.707
I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                           0.000 0.707
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])       0.000 0.707

Heterogeneity tau_eta (log-normal)
                                                                     prior   mean     sd
stratum interaction                                                                     
BID     I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                           -1.386  0.354
        I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                           -1.386  0.354
        I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                           -1.386  0.354
        I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])       -1.386  0.354
QD      I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                           -1.386  0.354
        I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                           -1.386  0.354
        I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                           -1.386  0.354
        I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])       -1.386  0.354

Correlation LKJ
interaction 
          1 

NonEXchangable priors
---------------------
Component parameters
Mean mu_log_beta
                          coefficient intercept        log_slope       
                          prior            mean     sd      mean     sd
component                                                              
I(log(DosesAdm1/dref[1]))                -0.693  2.000     0.000  1.000
I(log(DosesAdm2/dref[2]))                -0.693  2.000     0.000  1.000
I(log(DosesAdm3/dref[3]))                -0.693  2.000     0.000  1.000

Interaction parameters
Mean mu_eta
                                                             prior  mean    sd
interaction                                                                   
I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                           0.000 0.707
I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                           0.000 0.707
I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                           0.000 0.707
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])       0.000 0.707
> 
> # print a summary of the posterior (model parameters)
> print(blrmfit)
Bayesian Logistic Regression Model with EXchangeability-NonEXchangeability

Number of observations: 18 
Number of groups      : 3 
Number of strata      : 2 
Number of components  : 3 
Number of interactions: 4 
EXNEX components      : 3 
EXNEX interactions    : 0 

Observations per group:
       Group n Stratum n_total
1      Combo 3     BID      17
2 HistAgent1 7      QD      52
3 HistAgent2 8      QD      32

Groups per stratum:
  Stratum Groups n_total
1     BID      1      17
2      QD      2      84

Component posterior:
Population mean posterior mu_log_beta
intercept:
                          mean se_mean   sd 2.5%   50%   97.5% n_eff Rhat
I(log(DosesAdm1/dref[1])) -1.1    0.30 0.95 -2.8 -0.77 -0.0068    10 1.06
I(log(DosesAdm2/dref[2])) -3.2    0.11 0.35 -3.7 -3.22 -2.5628    10 0.96
I(log(DosesAdm3/dref[3])) -2.0    0.36 1.15 -4.0 -1.92 -0.5703    10 1.03
log-slope:
                            mean se_mean   sd  2.5%   50% 97.5% n_eff Rhat
I(log(DosesAdm1/dref[1]))  0.497    0.34 1.07 -1.30  0.85  1.70    10  0.9
I(log(DosesAdm2/dref[2]))  0.053    0.17 0.53 -0.59  0.20  0.82    10  0.9
I(log(DosesAdm3/dref[3])) -0.096    0.35 1.10 -1.55 -0.20  1.42    10  1.0

Population heterogeniety posterior tau_log_beta
intercept:
                              mean se_mean   sd  2.5%  50% 97.5% n_eff Rhat
BID,I(log(DosesAdm1/dref[1])) 0.27   0.041 0.13 0.095 0.26  0.45    10 0.96
BID,I(log(DosesAdm2/dref[2])) 0.43   0.142 0.45 0.045 0.18  1.18    10 0.90
BID,I(log(DosesAdm3/dref[3])) 0.44   0.122 0.39 0.053 0.28  0.95    10 0.92
QD,I(log(DosesAdm1/dref[1]))  0.80   0.199 0.63 0.123 0.61  1.75    10 0.90
QD,I(log(DosesAdm2/dref[2]))  0.54   0.114 0.36 0.146 0.46  1.23    10 0.90
QD,I(log(DosesAdm3/dref[3]))  0.62   0.140 0.44 0.206 0.41  1.36    10 0.91
log-slope:
                              mean se_mean    sd  2.5%  50% 97.5% n_eff Rhat
BID,I(log(DosesAdm1/dref[1])) 0.14   0.022 0.069 0.060 0.14  0.27    10 0.92
BID,I(log(DosesAdm2/dref[2])) 0.12   0.015 0.047 0.076 0.12  0.20    10 0.96
BID,I(log(DosesAdm3/dref[3])) 0.16   0.030 0.096 0.083 0.12  0.35    10 1.02
QD,I(log(DosesAdm1/dref[1]))  0.26   0.054 0.169 0.090 0.20  0.56    10 0.90
QD,I(log(DosesAdm2/dref[2]))  0.26   0.052 0.164 0.091 0.23  0.56    10 0.93
QD,I(log(DosesAdm3/dref[3]))  0.29   0.063 0.198 0.107 0.19  0.63    10 0.90

Population correlation posterior rho_log_beta
                            mean se_mean   sd  2.5%   50% 97.5% n_eff Rhat
I(log(DosesAdm1/dref[1])) -0.102    0.16 0.52 -0.68 -0.22  0.63    10 0.90
I(log(DosesAdm2/dref[2]))  0.122    0.17 0.52 -0.65  0.16  0.75    10 0.90
I(log(DosesAdm3/dref[3])) -0.013    0.21 0.66 -0.78 -0.22  0.83    10 0.98

Interaction model posterior:
Population mean posterior mu_eta
                                                              mean se_mean   sd
I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                     -0.49   0.094 0.30
I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                      0.11   0.105 0.33
I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                      0.05   0.280 0.89
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]) -0.11   0.192 0.61
                                                              2.5%    50% 97.5%
I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                     -0.89 -0.486 -0.11
I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                     -0.42  0.089  0.65
I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                     -0.99 -0.105  1.51
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]) -0.86 -0.315  0.69
                                                             n_eff Rhat
I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                        10 0.92
I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                        10 0.89
I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                        10 0.90
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])    10 0.90

Population heterogeniety posterior tau_eta
                                                                 mean se_mean
BID,I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                     0.26   0.020
BID,I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                     0.27   0.023
BID,I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                     0.26   0.043
BID,I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]) 0.24   0.024
QD,I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                      0.37   0.057
QD,I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                      0.21   0.020
QD,I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                      0.30   0.031
QD,I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])  0.25   0.052
                                                                    sd 2.5%
BID,I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                     0.064 0.16
BID,I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                     0.074 0.19
BID,I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                     0.130 0.14
BID,I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]) 0.052 0.15
QD,I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                      0.181 0.12
QD,I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                      0.055 0.13
QD,I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                      0.097 0.16
QD,I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])  0.158 0.13
                                                                  50% 97.5%
BID,I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                     0.27  0.35
BID,I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                     0.24  0.40
BID,I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                     0.21  0.45
BID,I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]) 0.25  0.29
QD,I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                      0.35  0.67
QD,I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                      0.21  0.30
QD,I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                      0.35  0.40
QD,I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])  0.17  0.53
                                                                 n_eff Rhat
BID,I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                      10.0 0.99
BID,I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                      10.0 0.91
BID,I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                       9.0 1.09
BID,I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])   4.8 1.51
QD,I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                       10.0 1.00
QD,I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                        7.1 1.21
QD,I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                       10.0 1.00
QD,I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])    9.0 1.07

Population correlation posterior Sigma_corr_eta
                                                                                                                            mean
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                          1.000
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         -0.140
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                          0.133
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     -0.012
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                         -0.140
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                          1.000
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                         -0.142
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                      0.104
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                          0.133
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         -0.142
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                          1.000
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     -0.056
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                     -0.012
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                      0.104
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                     -0.056
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])  1.000
                                                                                                                          se_mean
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                             NaN
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         8.1e-02
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                         1.8e-01
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     9.1e-02
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                         8.1e-02
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         3.7e-17
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                         1.2e-01
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     1.3e-01
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                         1.8e-01
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         1.2e-01
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                         2.3e-17
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     1.7e-01
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                     9.1e-02
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                     1.3e-01
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                     1.7e-01
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]) 3.4e-17
                                                                                                                               sd
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                         0.0e+00
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         2.6e-01
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                         5.7e-01
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     2.6e-01
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                         2.6e-01
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         1.2e-16
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                         3.8e-01
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     4.1e-01
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                         5.7e-01
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         3.8e-01
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                         5.2e-17
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     5.5e-01
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                     2.6e-01
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                     4.1e-01
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                     5.5e-01
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]) 8.3e-17
                                                                                                                           2.5%
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                          1.00
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         -0.62
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                         -0.75
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     -0.41
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                         -0.62
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                          1.00
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                         -0.53
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     -0.65
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                         -0.75
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         -0.53
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                          1.00
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     -0.85
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                     -0.41
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                     -0.65
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                     -0.85
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])  1.00
                                                                                                                               50%
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                          1.0e+00
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         -1.4e-02
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                          8.7e-02
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                      7.5e-05
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                         -1.4e-02
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                          1.0e+00
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                         -2.3e-01
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                      1.4e-01
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                          8.7e-02
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         -2.3e-01
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                          1.0e+00
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     -1.9e-01
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                      7.5e-05
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                      1.4e-01
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                     -1.9e-01
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])  1.0e+00
                                                                                                                          97.5%
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                         1.000
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         0.058
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                         0.803
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     0.387
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                         0.058
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         1.000
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                         0.483
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     0.616
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                         0.803
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         0.483
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                         1.000
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     0.662
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                     0.387
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                     0.616
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                     0.662
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]) 1.000
                                                                                                                          n_eff
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                           NaN
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                          10.0
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                          10.0
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                       8.4
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                          10.0
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                           9.9
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                          10.0
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                      10.0
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                          10.0
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                          10.0
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                           5.3
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                      10.0
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                       8.4
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                      10.0
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                      10.0
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])   6.0
                                                                                                                          Rhat
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                          NaN
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         0.89
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                         0.94
I(DosesAdm1/dref[1] * DosesAdm2/dref[2]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     0.95
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                         0.89
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         0.89
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                         0.91
I(DosesAdm1/dref[1] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     1.01
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                                         0.94
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                                         0.91
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                                         0.89
I(DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3])                     0.92
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2])                     0.95
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm3/dref[3])                     1.01
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm2/dref[2] * DosesAdm3/dref[3])                     0.92
I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]),I(DosesAdm1/dref[1] * DosesAdm2/dref[2] * DosesAdm3/dref[3]) 0.89
> 
> # summary of posterior for DLT rate by dose for observed covariate levels
> summ <- summary(blrmfit, interval_prob = c(0, 0.16, 0.33, 1))
> print(cbind(hist_combo3, summ))
     group_id DosesAdm1 DosesAdm2 DosesAdm3 Ntox Npat stratum       mean
1       Combo       400       800        80    0    4     BID 0.18063533
2       Combo       400       800       160    1    8     BID 0.18859470
3       Combo       400       800       240    2    5     BID 0.19946767
4  HistAgent1         0       240         0    0    5      QD 0.01594307
5  HistAgent1         0       400         0    0   10      QD 0.02970259
6  HistAgent1         0       800         0    1   11      QD 0.07437611
7  HistAgent1       240        80         0    0    4      QD 0.08715006
8  HistAgent1       400       400         0    1    6      QD 0.14278406
9  HistAgent1       400       800         0    0   11      QD 0.12615291
10 HistAgent1       400      1000         0    1    5      QD 0.11995256
11 HistAgent2         0         0        80    0    3      QD 0.01040847
12 HistAgent2         0         0       160    0    3      QD 0.01696091
13 HistAgent2         0         0       320    0    6      QD 0.03284409
14 HistAgent2         0         0       480    0    3      QD 0.06248484
15 HistAgent2         0         0       640    1    5      QD 0.11271069
16 HistAgent2       400         0       160    1    6      QD 0.21764580
17 HistAgent2       400         0       320    2    5      QD 0.23419873
18 HistAgent2       400         0       240    1    1      QD 0.22523863
            sd         2.5%         50%      97.5% (0,0.16] (0.16,0.33]
1  0.057966692 1.123703e-01 0.189645987 0.27636975      0.4         0.6
2  0.055944221 1.230393e-01 0.182604928 0.25823149      0.4         0.6
3  0.068745812 1.188315e-01 0.188846199 0.29928703      0.4         0.6
4  0.007310292 7.330719e-03 0.012482321 0.02722049      1.0         0.0
5  0.011385524 1.511994e-02 0.030841962 0.04566361      1.0         0.0
6  0.038001196 2.203776e-02 0.075887523 0.13179762      1.0         0.0
7  0.088678022 4.492417e-03 0.060343786 0.25609344      0.8         0.2
8  0.098239111 4.902992e-02 0.122614375 0.33487526      0.7         0.2
9  0.071360632 4.971304e-02 0.102038676 0.24125523      0.7         0.3
10 0.065763882 4.806927e-02 0.092984345 0.21956303      0.7         0.3
11 0.014444814 3.446052e-05 0.002584728 0.03687005      1.0         0.0
12 0.022582603 5.965285e-04 0.004686576 0.05882161      1.0         0.0
13 0.032333109 6.214605e-03 0.023279717 0.09722154      1.0         0.0
14 0.043130918 1.089183e-02 0.047955167 0.13198836      1.0         0.0
15 0.086035223 1.414730e-02 0.111224222 0.26528894      0.7         0.3
16 0.117676296 6.990167e-02 0.230712764 0.38508004      0.4         0.4
17 0.120344393 9.541708e-02 0.243193400 0.40330612      0.4         0.4
18 0.117911162 8.323642e-02 0.235979386 0.39293582      0.4         0.4
   (0.33,1]
1       0.0
2       0.0
3       0.0
4       0.0
5       0.0
6       0.0
7       0.0
8       0.1
9       0.0
10      0.0
11      0.0
12      0.0
13      0.0
14      0.0
15      0.0
16      0.2
17      0.2
18      0.2
> 
> # summary of posterior for DLT rate by dose for new set of covariate levels
> newdata <- expand.grid(
+   stratum = "BID", group_id = "Combo",
+   DosesAdm1 = 400, DosesAdm2 = 800, DosesAdm3 = c(320, 400, 600, 800),
+   stringsAsFactors = FALSE
+ )
> summ_pred <- summary(blrmfit, newdata = newdata, interval_prob = c(0, 0.16, 0.33, 1))
> print(cbind(newdata, summ_pred))
  stratum group_id DosesAdm1 DosesAdm2 DosesAdm3      mean         sd
1     BID    Combo       400       800       320 0.2130547 0.09214443
2     BID    Combo       400       800       400 0.2291666 0.12135756
3     BID    Combo       400       800       600 0.2782322 0.20422758
4     BID    Combo       400       800       800 0.3326425 0.27943159
        2.5%       50%     97.5% (0,0.16] (0.16,0.33] (0.33,1]
1 0.11231770 0.1839585 0.3557513      0.4         0.5      0.1
2 0.10472716 0.1659641 0.4156590      0.5         0.2      0.3
3 0.08192181 0.1766828 0.5925064      0.5         0.1      0.4
4 0.05960629 0.2407899 0.7640844      0.5         0.0      0.5
> 
> # update the model after observing additional data
> newdata$Npat <- rep(3, nrow(newdata))
> newdata$Ntox <- c(0, 1, 2, 2)
> library(dplyr)

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

> blrmfit_new <- update(blrmfit,
+                       data = rbind(hist_combo3, newdata) %>%
+                                arrange(stratum, group_id))
error occurred during calling the sampler; sampling not done
Error in blrm_exnex(formula = cbind(Ntox, Npat - Ntox) ~ 1 + I(log(DosesAdm1/dref[1])) |  : 
  Stan sampler did not run successfully!
Calls: update -> update.default -> eval -> eval -> blrm_exnex
Execution halted