Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: supporting methods to compute centrality and credible intervals for estimates #11

Open
IndrajeetPatil opened this issue Jan 15, 2021 · 1 comment

Comments

@IndrajeetPatil
Copy link
Contributor

Currently, metaBMA by default returns mean + HDIs:

library(metaBMA)
#> Loading required package: Rcpp
#> This is metaBMA version 0.6.6
#> - Default priors were changed in version 0.6.6.
#> - Since default priors may change again, it is safest to specify priors (even when using the defaults).
data(towels)
set.seed(123)
mb <- meta_bma(logOR, SE, study, towels)
#> Warning: There were 2 divergent transitions after warmup. See
#> http://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup
#> to find out why this is a problem and how to eliminate them.
#> Warning: Examine the pairs() plot to diagnose sampling problems
mb$estimates
#>               mean        sd        2.5%       50%     97.5% hpd95_lower
#> averaged 0.2145214 0.0882580  0.03546521 0.2165312 0.3813311  0.03963277
#> fixed    0.2208839 0.0783599  0.06556325 0.2219074 0.3747273  0.06047198
#> random   0.1988286 0.1062576 -0.02208767 0.2023509 0.3949067 -0.01460747
#>          hpd95_upper  n_eff Rhat
#> averaged   0.3846720     NA   NA
#> fixed      0.3662384 3485.5    1
#> random     0.3995670 5359.7    1

Created on 2021-01-15 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 4.0.3 (2020-10-10)
#>  os       macOS Mojave 10.14.6        
#>  system   x86_64, darwin17.0          
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_US.UTF-8                 
#>  ctype    en_US.UTF-8                 
#>  tz       Europe/Berlin               
#>  date     2021-01-15                  
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package        * version  date       lib source        
#>  assertthat       0.2.1    2019-03-21 [1] CRAN (R 4.0.2)
#>  bridgesampling   1.0-0    2020-02-26 [1] CRAN (R 4.0.2)
#>  Brobdingnag      1.2-6    2018-08-13 [1] CRAN (R 4.0.2)
#>  callr            3.5.1    2020-10-13 [1] CRAN (R 4.0.2)
#>  cli              2.2.0    2020-11-20 [1] CRAN (R 4.0.3)
#>  coda             0.19-4   2020-09-30 [1] CRAN (R 4.0.2)
#>  codetools        0.2-16   2018-12-24 [2] CRAN (R 4.0.3)
#>  colorspace       2.0-0    2020-11-11 [1] CRAN (R 4.0.2)
#>  crayon           1.3.4    2017-09-16 [1] CRAN (R 4.0.2)
#>  curl             4.3      2019-12-02 [1] CRAN (R 4.0.1)
#>  desc             1.2.0    2018-05-01 [1] CRAN (R 4.0.2)
#>  devtools         2.3.2    2020-09-18 [1] CRAN (R 4.0.2)
#>  digest           0.6.27   2020-10-24 [1] CRAN (R 4.0.2)
#>  dplyr            1.0.2    2020-08-18 [1] CRAN (R 4.0.2)
#>  ellipsis         0.3.1    2020-05-15 [1] CRAN (R 4.0.2)
#>  evaluate         0.14     2019-05-28 [1] CRAN (R 4.0.1)
#>  fansi            0.4.1    2020-01-08 [1] CRAN (R 4.0.2)
#>  fs               1.5.0    2020-07-31 [1] CRAN (R 4.0.2)
#>  generics         0.1.0    2020-10-31 [1] CRAN (R 4.0.2)
#>  ggplot2          3.3.3    2020-12-30 [1] CRAN (R 4.0.3)
#>  glue             1.4.2    2020-08-27 [1] CRAN (R 4.0.2)
#>  gridExtra        2.3      2017-09-09 [1] CRAN (R 4.0.2)
#>  gtable           0.3.0    2019-03-25 [1] CRAN (R 4.0.2)
#>  highr            0.8      2019-03-20 [1] CRAN (R 4.0.2)
#>  htmltools        0.5.1    2021-01-12 [1] CRAN (R 4.0.3)
#>  inline           0.3.17   2020-12-01 [1] CRAN (R 4.0.3)
#>  jsonlite         1.7.2    2020-12-09 [1] CRAN (R 4.0.3)
#>  knitr            1.30     2020-09-22 [1] CRAN (R 4.0.2)
#>  LaplacesDemon    16.1.4   2020-02-06 [1] CRAN (R 4.0.2)
#>  lattice          0.20-41  2020-04-02 [2] CRAN (R 4.0.3)
#>  lifecycle        0.2.0    2020-03-06 [1] CRAN (R 4.0.2)
#>  logspline        2.1.16   2020-05-08 [1] CRAN (R 4.0.2)
#>  loo              2.4.1    2020-12-09 [1] CRAN (R 4.0.3)
#>  magrittr         2.0.1    2020-11-17 [1] CRAN (R 4.0.3)
#>  Matrix           1.2-18   2019-11-27 [2] CRAN (R 4.0.3)
#>  matrixStats      0.57.0   2020-09-25 [1] CRAN (R 4.0.2)
#>  memoise          1.1.0    2017-04-21 [1] CRAN (R 4.0.2)
#>  metaBMA        * 0.6.6    2021-01-08 [1] CRAN (R 4.0.3)
#>  munsell          0.5.0    2018-06-12 [1] CRAN (R 4.0.2)
#>  mvtnorm          1.1-1    2020-06-09 [1] CRAN (R 4.0.2)
#>  pillar           1.4.7    2020-11-20 [1] CRAN (R 4.0.3)
#>  pkgbuild         1.2.0    2020-12-15 [1] CRAN (R 4.0.3)
#>  pkgconfig        2.0.3    2019-09-22 [1] CRAN (R 4.0.2)
#>  pkgload          1.1.0    2020-05-29 [1] CRAN (R 4.0.2)
#>  prettyunits      1.1.1    2020-01-24 [1] CRAN (R 4.0.2)
#>  processx         3.4.5    2020-11-30 [1] CRAN (R 4.0.3)
#>  ps               1.5.0    2020-12-05 [1] CRAN (R 4.0.3)
#>  purrr            0.3.4    2020-04-17 [1] CRAN (R 4.0.2)
#>  R6               2.5.0    2020-10-28 [1] CRAN (R 4.0.2)
#>  Rcpp           * 1.0.5    2020-07-06 [1] CRAN (R 4.0.2)
#>  RcppParallel     5.0.2    2020-06-24 [1] CRAN (R 4.0.2)
#>  remotes          2.2.0    2020-07-21 [1] CRAN (R 4.0.2)
#>  rlang            0.4.10   2020-12-30 [1] CRAN (R 4.0.3)
#>  rmarkdown        2.6      2020-12-14 [1] CRAN (R 4.0.3)
#>  rprojroot        2.0.2    2020-11-15 [1] CRAN (R 4.0.3)
#>  rstan            2.21.2   2020-07-27 [1] CRAN (R 4.0.3)
#>  rstantools       2.1.1    2020-07-06 [1] CRAN (R 4.0.2)
#>  scales           1.1.1    2020-05-11 [1] CRAN (R 4.0.2)
#>  sessioninfo      1.1.1    2018-11-05 [1] CRAN (R 4.0.2)
#>  StanHeaders      2.21.0-7 2020-12-17 [1] CRAN (R 4.0.3)
#>  stringi          1.5.3    2020-09-09 [1] CRAN (R 4.0.2)
#>  stringr          1.4.0    2019-02-10 [1] CRAN (R 4.0.2)
#>  testthat         3.0.1    2020-12-17 [1] CRAN (R 4.0.3)
#>  tibble           3.0.4    2020-10-12 [1] CRAN (R 4.0.2)
#>  tidyselect       1.1.0    2020-05-11 [1] CRAN (R 4.0.2)
#>  usethis          2.0.0    2020-12-10 [1] CRAN (R 4.0.3)
#>  V8               3.4.0    2020-11-04 [1] CRAN (R 4.0.2)
#>  vctrs            0.3.6    2020-12-17 [1] CRAN (R 4.0.3)
#>  withr            2.3.0    2020-09-22 [1] CRAN (R 4.0.2)
#>  xfun             0.20     2021-01-06 [1] CRAN (R 4.0.3)
#>  yaml             2.2.1    2020-02-01 [1] CRAN (R 4.0.2)
#> 
#> [1] /Users/patil/Library/R/4.0/library
#> [2] /Library/Frameworks/R.framework/Versions/4.0/Resources/library

But I was wondering if you would be willing to support two additional arguments:

@danheck
Copy link
Owner

danheck commented Jan 17, 2021

Note that the "ETI" ist already available by providing the 2.5% and 97.5% quantiles, similarly as the "median". So only the MAP and SI are missing.

Adding these options could be useful, even though the results should usually be quite similar as long as the posterior is somewhat symmetric. However, since the package uses two approaches to obtaining estimates (integral and stan) it would require some time to implement this. I will put it on the to-do list but this could take quite a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants