IndrajeetPatil / statsExpressions

Tidy data frames and expressions with statistical summaries 📜
https://indrajeetpatil.github.io/statsExpressions/
Other
312 stars 20 forks source link

checking results from metaBMA #22

Closed IndrajeetPatil closed 4 years ago

IndrajeetPatil commented 4 years ago
library(metaBMA)
#> Loading required package: Rcpp

data(towels)
set.seed(123)
meta_random(logOR, SE, study, data = towels)

#> Warning: There were 2 divergent transitions after warmup. Increasing adapt_delta above 0.95 may help. See
#> http://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup
#> Warning: Examine the pairs() plot to diagnose sampling problems

#> ### Bayesian Random-Effects Meta-Analysis ### 
#>    Prior on d:      'norm' (mean=0, sd=0.3) with support on the interval [-Inf,Inf]. 
#>    Prior on tau:    'invgamma' (shape=1, scale=0.15) with support on the interval [0,Inf]. 
#> 
#> # Bayes factors:
#>            (denominator)
#> (numerator) random_H0 random_H1
#>   random_H0         1     0.501
#>   random_H1         2     1.000

#> # Posterior summary statistics of random-effects model:
#>      mean    sd   2.5%   50% 97.5% hpd95_lower hpd95_upper  n_eff  Rhat
#> d   0.183 0.102 -0.041 0.189 0.368      -0.027       0.376 5352.8 1.001
#> tau 0.135 0.097  0.033 0.109 0.391       0.019       0.321 3909.1 1.000

Created on 2020-01-26 by the reprex package (v0.3.0)

Session info ``` r devtools::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 3.6.2 (2019-12-12) #> os macOS Mojave 10.14.6 #> system x86_64, darwin15.6.0 #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz Europe/Berlin #> date 2020-01-26 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.0) #> backports 1.1.5 2019-10-02 [1] CRAN (R 3.6.0) #> bridgesampling 0.8-1 2020-01-16 [1] CRAN (R 3.6.0) #> Brobdingnag 1.2-6 2018-08-13 [1] CRAN (R 3.6.0) #> callr 3.4.1 2020-01-24 [1] CRAN (R 3.6.2) #> cli 2.0.1 2020-01-08 [1] CRAN (R 3.6.2) #> coda 0.19-3 2019-07-05 [1] CRAN (R 3.6.0) #> codetools 0.2-16 2018-12-24 [2] CRAN (R 3.6.2) #> colorspace 1.4-1 2019-03-18 [1] CRAN (R 3.6.0) #> crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.0) #> desc 1.2.0 2018-05-01 [1] CRAN (R 3.6.0) #> devtools 2.2.1 2019-09-24 [1] CRAN (R 3.6.0) #> digest 0.6.23 2019-11-23 [1] CRAN (R 3.6.0) #> dplyr 0.8.3.9000 2019-10-15 [1] Github (tidyverse/dplyr@55f4151) #> ellipsis 0.3.0 2019-09-20 [1] CRAN (R 3.6.0) #> evaluate 0.14 2019-05-28 [1] CRAN (R 3.6.0) #> fansi 0.4.1 2020-01-08 [1] CRAN (R 3.6.2) #> fs 1.3.1 2019-05-06 [1] CRAN (R 3.6.0) #> ggplot2 3.2.1 2019-08-10 [1] CRAN (R 3.6.0) #> glue 1.3.1 2019-03-12 [1] CRAN (R 3.6.0) #> gridExtra 2.3 2017-09-09 [1] CRAN (R 3.6.0) #> gtable 0.3.0 2019-03-25 [1] CRAN (R 3.6.0) #> highr 0.8 2019-03-20 [1] CRAN (R 3.6.0) #> htmltools 0.4.0 2019-10-04 [1] CRAN (R 3.6.0) #> inline 0.3.15 2018-05-18 [1] CRAN (R 3.6.0) #> knitr 1.27 2020-01-16 [1] CRAN (R 3.6.0) #> LaplacesDemon 16.1.1 2018-06-30 [1] CRAN (R 3.6.0) #> lattice 0.20-38 2018-11-04 [2] CRAN (R 3.6.2) #> lazyeval 0.2.2 2019-03-15 [1] CRAN (R 3.6.0) #> lifecycle 0.1.0 2019-08-01 [1] CRAN (R 3.6.0) #> logspline 2.1.15 2019-11-08 [1] CRAN (R 3.6.0) #> loo 2.2.0 2019-12-19 [1] CRAN (R 3.6.2) #> magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0) #> Matrix 1.2-18 2019-11-27 [2] CRAN (R 3.6.2) #> matrixStats 0.55.0 2019-09-07 [1] CRAN (R 3.6.0) #> memoise 1.1.0 2017-04-21 [1] CRAN (R 3.6.0) #> metaBMA * 0.6.2 2019-09-16 [1] CRAN (R 3.6.0) #> munsell 0.5.0 2018-06-12 [1] CRAN (R 3.6.0) #> mvtnorm 1.0-12 2020-01-09 [1] CRAN (R 3.6.0) #> pillar 1.4.3 2019-12-20 [1] CRAN (R 3.6.2) #> pkgbuild 1.0.6 2019-10-09 [1] CRAN (R 3.6.0) #> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 3.6.0) #> pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.6.0) #> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 3.6.2) #> processx 3.4.1 2019-07-18 [1] CRAN (R 3.6.0) #> ps 1.3.0 2018-12-21 [1] CRAN (R 3.6.0) #> purrr 0.3.3 2019-10-18 [1] CRAN (R 3.6.0) #> R6 2.4.1 2019-11-12 [1] CRAN (R 3.6.0) #> Rcpp * 1.0.3 2019-11-08 [1] CRAN (R 3.6.1) #> remotes 2.1.0 2019-06-24 [1] CRAN (R 3.6.0) #> rlang 0.4.3 2020-01-24 [1] CRAN (R 3.6.2) #> rmarkdown 2.1 2020-01-20 [1] CRAN (R 3.6.2) #> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.6.0) #> rstan 2.19.2 2019-07-09 [1] CRAN (R 3.6.0) #> rstantools 2.0.0 2019-09-15 [1] CRAN (R 3.6.0) #> scales 1.1.0 2019-11-18 [1] CRAN (R 3.6.0) #> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.0) #> StanHeaders 2.21.0-1 2020-01-19 [1] CRAN (R 3.6.2) #> stringi 1.4.5 2020-01-11 [1] CRAN (R 3.6.2) #> stringr 1.4.0 2019-02-10 [1] CRAN (R 3.6.0) #> testthat 2.3.1 2019-12-01 [1] CRAN (R 3.6.0) #> tibble 2.1.3 2019-06-06 [1] CRAN (R 3.6.0) #> tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.6.0) #> usethis 1.5.1 2019-07-04 [1] CRAN (R 3.6.0) #> withr 2.1.2 2018-03-15 [1] CRAN (R 3.6.0) #> xfun 0.12 2020-01-13 [1] CRAN (R 3.6.2) #> yaml 2.2.0 2018-07-25 [1] CRAN (R 3.6.0) #> #> [1] /Users/patil/Library/R/3.6/library #> [2] /Library/Frameworks/R.framework/Versions/3.6/Resources/library ```
IndrajeetPatil commented 4 years ago
library(metaBMA)
#> Loading required package: Rcpp

data(towels)
set.seed(123)
meta_random(logOR, SE, study, data = towels)

#> Warning: There were 1 divergent transitions after warmup. Increasing adapt_delta above 0.95 may help. See
#> http://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup
#> Warning: Examine the pairs() plot to diagnose sampling problems

#> ### Bayesian Random-Effects Meta-Analysis ### 
#>    Prior on d:      'norm' (mean=0, sd=0.3) with support on the interval [-Inf,Inf]. 
#>    Prior on tau:    'invgamma' (shape=1, scale=0.15) with support on the interval [0,Inf]. 

#> # Bayes factors:
#>            (denominator)
#> (numerator) random_H0 random_H1
#>   random_H0         1     0.501
#>   random_H1         2     1.000

#> # Posterior summary statistics of random-effects model:
#>      mean    sd   2.5%   50% 97.5% hpd95_lower hpd95_upper  n_eff Rhat
#> d   0.185 0.101 -0.033 0.191 0.371      -0.026       0.376 5478.3    1
#> tau 0.134 0.095  0.033 0.108 0.380       0.021       0.313 4119.3    1
IndrajeetPatil commented 4 years ago

Good to know but has nothing to do with statsExpressions, so closing it.