danheck / metabma Goto Github PK
View Code? Open in Web Editor NEWBayesian Model Averaging for Random and Fixed Effects Meta-Analysis
Home Page: https://danheck.github.io/metaBMA/
Bayesian Model Averaging for Random and Fixed Effects Meta-Analysis
Home Page: https://danheck.github.io/metaBMA/
The cex.axis
argument appears to not be successfully altering the size of the effect size axis labels.
In plot_forest.default
, for the cex.axis
argument to influence the effect size axis size, the cex.axis
parameter needs to be passed to its plot
command:
plot(
x = Effect, y = -100, xlim = range(xxx),
yaxt = "n", ylab = "", las = 1,
ylim = c(-n.ests, n.studies),
bty = "n", ...
)
The documentation mentions-
But changing the value of ci
, doesn't seem to change estimates in the output. Is this by design?
library(metaBMA)
#> Loading required package: Rcpp
data(towels)
# default
set.seed(123)
mr <-
meta_random(
logOR,
SE,
study,
data = towels,
ci = 0.95
)
#> Warning: There were 4 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
mr$estimates
#> mean sd 2.5% 50% 97.5% hpd95_lower
#> d 0.1820016 0.10363018 -0.03902097 0.1877645 0.3670940 -0.02095039
#> tau 0.1355887 0.09893691 0.03348296 0.1081037 0.4037003 0.02027280
#> hpd95_upper n_eff Rhat
#> d 0.3811258 3974.8 1
#> tau 0.3296088 3145.4 1
# change ci value
set.seed(123)
mr <-
meta_random(
logOR,
SE,
study,
data = towels,
ci = 0.99
)
#> Warning: There were 4 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
mr$estimates
#> mean sd 2.5% 50% 97.5% hpd95_lower
#> d 0.1820016 0.10363018 -0.03902097 0.1877645 0.3670940 -0.02095039
#> tau 0.1355887 0.09893691 0.03348296 0.1081037 0.4037003 0.02027280
#> hpd95_upper n_eff Rhat
#> d 0.3811258 3974.8 1
#> tau 0.3296088 3145.4 1
Is it possible to add a priors robusteness check?
The dev
branch is behind the master one; in the README
is suggested to install w/ ref = "dev"
for the development version (supposed to be more updated than the master/CRAN one), but that way the version installed is the 0.6.0
.
On the other hand, installing from GitHub w/o ref = "dev"
will install the master
branch release, which corresponds to the last, now, 0.6.2
package version.
Suggestions: remove the indication "ref = dev
" from README
, or merge master
into dev
.
Context: easystats/parameters#347 (comment)
Maybe also leave out the internal numbers rscale_contin
and rscale_discrete
to avoid this confusion? At least until the moderator analysis is implemented.
Will you be open to having another quick release with these changes in the near future (pre-Christmas)?
Currently, metaBMA
by default returns mean
+ HDI
s:
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)
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:
"median"
, "mean"
(current default), or "MAP"
."HDI"
, "ETI"
(https://easystats.github.io/bayestestR/reference/eti.html), or "SI"
(https://easystats.github.io/bayestestR/reference/si.html).Trouble loading the new version (0.6.3
) of metaBMA
package on a Windows machine:
> packageVersion("metaBMA")
[1] ‘0.6.3’
> library(metaBMA)
Loading required package: Rcpp
Error: package or namespace load failed for ‘metaBMA’ in .doLoadActions(where, attach):
error in load action .__A__.1 for package metaBMA: is(module, "character"): object 'm' not found
This is the trace I see:
> traceback()
6: stop(msg, call. = FALSE, domain = NA)
5: value[[3L]](cond)
4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
3: tryCatchList(expr, classes, parentenv, handlers)
2: tryCatch({
attr(package, "LibPath") <- which.lib.loc
ns <- loadNamespace(package, lib.loc)
env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)
}, error = function(e) {
P <- if (!is.null(cc <- conditionCall(e)))
paste(" in", deparse(cc)[1L])
else ""
msg <- gettextf("package or namespace load failed for %s%s:\n %s",
sQuote(package), P, conditionMessage(e))
if (logical.return)
message(paste("Error:", msg), domain = NA)
else stop(msg, call. = FALSE, domain = NA)
})
1: library(metaBMA)
Here is session info:
> sessioninfo::session_info(include_base = TRUE)
- Session info ---------------------------------------------------------------------------------------------------------------------------
setting value
version R Under development (unstable) (2020-02-28 r77874)
os Windows 10 x64
system x86_64, mingw32
ui RStudio
language (EN)
collate English_United States.1252
ctype English_United States.1252
tz Europe/Berlin
date 2020-06-04
- Packages -------------------------------------------------------------------------------------------------------------------------------
! package * version date lib source
assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.0)
base * 4.0.0 2020-02-29 [?] local
cli 2.0.2 2020-02-28 [1] CRAN (R 4.0.0)
P compiler 4.0.0 2020-02-29 [2] local
crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.0)
P datasets * 4.0.0 2020-02-29 [2] local
digest 0.6.25 2020-02-23 [1] CRAN (R 4.0.0)
evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.0)
fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.0)
glue 1.4.1 2020-05-13 [1] CRAN (R 4.0.0)
P graphics * 4.0.0 2020-02-29 [2] local
P grDevices * 4.0.0 2020-02-29 [2] local
htmltools 0.4.0 2019-10-04 [1] CRAN (R 4.0.0)
knitr 1.28 2020-02-06 [1] CRAN (R 4.0.0)
P methods * 4.0.0 2020-02-29 [2] local
Rcpp 1.0.4.6 2020-04-09 [1] CRAN (R 4.0.0)
rlang 0.4.6 2020-05-02 [1] CRAN (R 4.0.0)
rmarkdown 2.2 2020-05-31 [1] CRAN (R 4.0.0)
rstudioapi 0.11 2020-02-07 [1] CRAN (R 4.0.0)
sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.0)
P stats * 4.0.0 2020-02-29 [2] local
P tools 4.0.0 2020-02-29 [2] local
P utils * 4.0.0 2020-02-29 [2] local
withr 2.2.0 2020-04-20 [1] CRAN (R 4.0.0)
xfun 0.14 2020-05-20 [1] CRAN (R 4.0.0)
yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.0)
[1] C:/Users/inp099/Documents/R/win-library/4.0
[2] C:/Program Files/R/R-devel/library
P -- Loaded and on-disk path mismatch.
Hi!
I have installed your package both from CRAN version and developer GitHub version, but when trying to load it in my R session via library(metaBMA) I keep getting this error:
Loading required package: Rcpp
Error: package or namespace load failed for ‘metaBMA’ in .doLoadActions(where, attach):
error in load action .A.1 for package metaBMA: is(module, "character"): object 'm' not found
Do you have any idea what could be wrong or how to solve it?
Thanks in advance!
I try to build metaBMA using R 4.0.0 running on Unbuntu 18.04LTS (gcc 5.4.0) but it fails with the following error..
/home/user/R/x86_64-pc-linux-gnu-library/4.0/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp:619:15: error: invalid use of ‘auto’ return (*vi)(args...); ^
I understand that it is possibly related to stan, still rstan package compile very well.. Any idea ?
thx.
I would like to change the title text of the plot generated by plot_forest
, but using the main
argument does not work because it is hard-coded here instead of being passed in from the main call:
plot_forest.default(meta,
from = from, to = to, summary = summary,
shrinked = shrinked, cex.axis = cex.axis,
main = "Meta-Analysis with Model-Averaging", ...
)
Example:
> plot_forest(fit_BMA_test, shrinked ="",
+ mar = c(4.5, 25, 4, 0.3),
+ cex.axis = 2,
+ cex.main = 2,
+ cex.lab = 2, main="Test")
Error in plot.default(x = Effect, y = -100, xlim = range(xxx), yaxt = "n", :
formal argument "main" matched by multiple actual arguments
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.