Closed IndrajeetPatil closed 4 years ago
It seems to work correctly for me with the latest dev versions of brms and broom.mixed.
What if you use the development version of tibble? I think that’s the source of this issue.
@IndrajeetPatil you referred to tibble 3.0.0, but at least on the master branch it's still at version 2.99.99.9014 . Before I dig in, can you be more precise about the version you're using? (I don't see anything in the "Breaking changes" sections of the NEWS file that gives me any clues ...)
Sorry, should have been more precise. You are right that the current version is 2.99.99.9014
, but it will be submitted to CRAN on the 18th of March as 3.0.0
, so I was referring to it by that version.
At any rate, here is a full reprex with session information:
set.seed(123)
library(brms)
#> Loading required package: Rcpp
#> Loading 'brms' package (version 2.12.0). Useful instructions
#> can be found by typing help('brms'). A more detailed introduction
#> to the package is available through vignette('brms_overview').
#>
#> Attaching package: 'brms'
#> The following object is masked from 'package:stats':
#>
#> ar
library(broom.mixed)
#> Registered S3 method overwritten by 'broom.mixed':
#> method from
#> tidy.gamlss broom
data("epilepsy")
mod <-
brms::brm(
formula = count ~ Age + Base * Trt + (1 | patient),
data = epilepsy,
family = poisson(),
silent = TRUE
)
#> Compiling the C++ model
#> Start sampling
#>
#> SAMPLING FOR MODEL '3230147e4459b899d8278ea231f1d3bb' NOW (CHAIN 1).
#> Chain 1:
#> Chain 1: Gradient evaluation took 0 seconds
#> Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0 seconds.
#> Chain 1: Adjust your expectations accordingly!
#> Chain 1:
#> Chain 1:
#> Chain 1: Iteration: 1 / 2000 [ 0%] (Warmup)
#> Chain 1: Iteration: 200 / 2000 [ 10%] (Warmup)
#> Chain 1: Iteration: 400 / 2000 [ 20%] (Warmup)
#> Chain 1: Iteration: 600 / 2000 [ 30%] (Warmup)
#> Chain 1: Iteration: 800 / 2000 [ 40%] (Warmup)
#> Chain 1: Iteration: 1000 / 2000 [ 50%] (Warmup)
#> Chain 1: Iteration: 1001 / 2000 [ 50%] (Sampling)
#> Chain 1: Iteration: 1200 / 2000 [ 60%] (Sampling)
#> Chain 1: Iteration: 1400 / 2000 [ 70%] (Sampling)
#> Chain 1: Iteration: 1600 / 2000 [ 80%] (Sampling)
#> Chain 1: Iteration: 1800 / 2000 [ 90%] (Sampling)
#> Chain 1: Iteration: 2000 / 2000 [100%] (Sampling)
#> Chain 1:
#> Chain 1: Elapsed Time: 13.172 seconds (Warm-up)
#> Chain 1: 5.13 seconds (Sampling)
#> Chain 1: 18.302 seconds (Total)
#> Chain 1:
#>
#> SAMPLING FOR MODEL '3230147e4459b899d8278ea231f1d3bb' NOW (CHAIN 2).
#> Chain 2:
#> Chain 2: Gradient evaluation took 0 seconds
#> Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0 seconds.
#> Chain 2: Adjust your expectations accordingly!
#> Chain 2:
#> Chain 2:
#> Chain 2: Iteration: 1 / 2000 [ 0%] (Warmup)
#> Chain 2: Iteration: 200 / 2000 [ 10%] (Warmup)
#> Chain 2: Iteration: 400 / 2000 [ 20%] (Warmup)
#> Chain 2: Iteration: 600 / 2000 [ 30%] (Warmup)
#> Chain 2: Iteration: 800 / 2000 [ 40%] (Warmup)
#> Chain 2: Iteration: 1000 / 2000 [ 50%] (Warmup)
#> Chain 2: Iteration: 1001 / 2000 [ 50%] (Sampling)
#> Chain 2: Iteration: 1200 / 2000 [ 60%] (Sampling)
#> Chain 2: Iteration: 1400 / 2000 [ 70%] (Sampling)
#> Chain 2: Iteration: 1600 / 2000 [ 80%] (Sampling)
#> Chain 2: Iteration: 1800 / 2000 [ 90%] (Sampling)
#> Chain 2: Iteration: 2000 / 2000 [100%] (Sampling)
#> Chain 2:
#> Chain 2: Elapsed Time: 15.301 seconds (Warm-up)
#> Chain 2: 67.226 seconds (Sampling)
#> Chain 2: 82.527 seconds (Total)
#> Chain 2:
#>
#> SAMPLING FOR MODEL '3230147e4459b899d8278ea231f1d3bb' NOW (CHAIN 3).
#> Chain 3:
#> Chain 3: Gradient evaluation took 0 seconds
#> Chain 3: 1000 transitions using 10 leapfrog steps per transition would take 0 seconds.
#> Chain 3: Adjust your expectations accordingly!
#> Chain 3:
#> Chain 3:
#> Chain 3: Iteration: 1 / 2000 [ 0%] (Warmup)
#> Chain 3: Iteration: 200 / 2000 [ 10%] (Warmup)
#> Chain 3: Iteration: 400 / 2000 [ 20%] (Warmup)
#> Chain 3: Iteration: 600 / 2000 [ 30%] (Warmup)
#> Chain 3: Iteration: 800 / 2000 [ 40%] (Warmup)
#> Chain 3: Iteration: 1000 / 2000 [ 50%] (Warmup)
#> Chain 3: Iteration: 1001 / 2000 [ 50%] (Sampling)
#> Chain 3: Iteration: 1200 / 2000 [ 60%] (Sampling)
#> Chain 3: Iteration: 1400 / 2000 [ 70%] (Sampling)
#> Chain 3: Iteration: 1600 / 2000 [ 80%] (Sampling)
#> Chain 3: Iteration: 1800 / 2000 [ 90%] (Sampling)
#> Chain 3: Iteration: 2000 / 2000 [100%] (Sampling)
#> Chain 3:
#> Chain 3: Elapsed Time: 10.545 seconds (Warm-up)
#> Chain 3: 5.95 seconds (Sampling)
#> Chain 3: 16.495 seconds (Total)
#> Chain 3:
#>
#> SAMPLING FOR MODEL '3230147e4459b899d8278ea231f1d3bb' NOW (CHAIN 4).
#> Chain 4:
#> Chain 4: Gradient evaluation took 0 seconds
#> Chain 4: 1000 transitions using 10 leapfrog steps per transition would take 0 seconds.
#> Chain 4: Adjust your expectations accordingly!
#> Chain 4:
#> Chain 4:
#> Chain 4: Iteration: 1 / 2000 [ 0%] (Warmup)
#> Chain 4: Iteration: 200 / 2000 [ 10%] (Warmup)
#> Chain 4: Iteration: 400 / 2000 [ 20%] (Warmup)
#> Chain 4: Iteration: 600 / 2000 [ 30%] (Warmup)
#> Chain 4: Iteration: 800 / 2000 [ 40%] (Warmup)
#> Chain 4: Iteration: 1000 / 2000 [ 50%] (Warmup)
#> Chain 4: Iteration: 1001 / 2000 [ 50%] (Sampling)
#> Chain 4: Iteration: 1200 / 2000 [ 60%] (Sampling)
#> Chain 4: Iteration: 1400 / 2000 [ 70%] (Sampling)
#> Chain 4: Iteration: 1600 / 2000 [ 80%] (Sampling)
#> Chain 4: Iteration: 1800 / 2000 [ 90%] (Sampling)
#> Chain 4: Iteration: 2000 / 2000 [100%] (Sampling)
#> Chain 4:
#> Chain 4: Elapsed Time: 9.563 seconds (Warm-up)
#> Chain 4: 8.124 seconds (Sampling)
#> Chain 4: 17.687 seconds (Total)
#> Chain 4:
#> Warning: There were 1000 transitions after warmup that exceeded the maximum treedepth. Increase max_treedepth above 10. See
#> http://mc-stan.org/misc/warnings.html#maximum-treedepth-exceeded
#> Warning: There were 1 chains where the estimated Bayesian Fraction of Missing Information was low. See
#> http://mc-stan.org/misc/warnings.html#bfmi-low
#> Warning: Examine the pairs() plot to diagnose sampling problems
#> Warning: The largest R-hat is 1.44, 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
broom.mixed::tidy(mod, conf.int = TRUE)
#> # A tibble: 6 x 8
#> effect component group term estimate std.error conf.low[,"2.5%~ [,"97.5%"]
#> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 fixed cond <NA> (Int~ 5.37e-1 0.404 -0.304 1.31
#> 2 fixed cond <NA> Age 1.37e-2 0.0131 -0.0107 0.0408
#> 3 fixed cond <NA> Base 2.81e-2 0.00502 0.0186 0.0368
#> 4 fixed cond <NA> Trt1 -2.64e-1 0.241 -0.781 0.190
#> 5 fixed cond <NA> Base~ 9.00e-5 0.00611 -0.0103 0.0128
#> 6 ran_p~ cond pati~ sd__~ 5.59e-1 0.101 0.292 0.717
#> # ... with 2 more variables: conf.high[,"2.5%"] <dbl>, [,"97.5%"] <dbl>
Created on 2020-03-08 by the reprex package (v0.3.0)
Also, as I said in my initial comment, the tibble
thing is just my guess.
Another big difference is that I am working with R-devel, not sure if that might have something to do with this.
This probably has to do with
tibble 3.0.0
:Instead of
conf.low
andconf.high
for confidence intervals, now you get the following-