Skip to content

Commit

Permalink
Meta regression (#21)
Browse files Browse the repository at this point in the history
* down-weighting

* rename main.R->RoBMA.R

* RoBMA.reg

* summary functions

* fixes

* rename main.R->RoBMA.R

* RoBMA.reg

* summary functions

* fixes

* additional fixes

* updating unit tests

* plot function

* updating diagnostics to BayesTools

* fix plots

* do_not_fit feature

* do_not_fit feature (2)

* fixing the weights parameterization

* add the students data set

* add the students data set (1)

* fixes

* vignette updates (1)

* additional models

* additional models II

* additional models (3)

* updates

* updating the vignette --still not done yet

* almost finished vignette draft

* more model results

* Create fit_wPSMA_reg10.RDS

* updating vignettte

* Update .gitignore

* Create fit_PSMA_reg10.RDS

* Create fit_3PP_reg10

* changing the multivariate normal C++ implementation to the same one as in bugs

* fit_3PP_reg10 (non-converged)

* fix multivariate

* updating hierarchical model specification & adding a vignette

* Update fit_3PP_reg10.RDS

* fixes and update unit tests

* add AMPPS vignette

* updates

* updates

* include Lui2-15 data data set & update the vignette

* adding inverse_sqrt weights

* fixing data input checks

* ggplot2 unit test updates

* Update utilities.R

* update with BayesTools

* remove old meta-regression viggnete & change defaults priors for factors/covariates

* add predictor scaling warning

* Update plots.R

* Update DESCRIPTION

* Update RoBMA.R

* check_setup.reg() + fixes

* unit tests 3-5

* unit test 6

* unit test 7

* coverage on windows (?)

* Revert "coverage on windows (?)"

This reverts commit 78b4880.

* reparameterization of the `weighted` models experimental feature (vol I)

* undo reparameterization of the `weighted` models experimental feature

* update documentation

* Update check-input-and-settings.R

* improving regression specification

* update documentation

* Update test-2-distributions.R

* add unit tests for regression parameters & update R4.3 tests

* updating summary.RoBMA.Rd

* update with BayesTools

* Update test-5-methods.R

* marginal functions + unit test update

* unit tests + small fixes

* change coverage tests

* Update utilities.R

* add regression CRAN test and mute mesages

* small updates

* update README

* Update prior_informed.Rd

* update actions
  • Loading branch information
FBartos authored May 31, 2023
1 parent 0bd253e commit 060b631
Show file tree
Hide file tree
Showing 226 changed files with 14,677 additions and 2,855 deletions.
Binary file added .RData
Binary file not shown.
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fail-fast: false
matrix:
config:
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: windows-latest, r: 'release'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ RoBMA.Rcheck
.Rprofile
/doc/
/Meta/
models/MetaRegression/fit_wPSMA_reg10/*.RDS
models/MetaRegression/fit_PSMA_reg10/*.RDS
models/MetaRegression/fit_3PP_reg10/*.RDS
models/MetaRegression/*
16 changes: 9 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: RoBMA
Title: Robust Bayesian Meta-Analyses
Version: 2.3.2
Version: 3.0.0
Maintainer: František Bartoš <[email protected]>
Authors@R: c(
person("František", "Bartoš", role = c("aut", "cre"),
Expand All @@ -21,9 +21,9 @@ Description: A framework for estimating ensembles of meta-analytic models
combine the competing meta-analytic models into a model ensemble, weights
the posterior parameter distributions based on posterior model probabilities
and uses Bayes factors to test for the presence or absence of the
individual components (e.g., effect vs. no effect; Bartoš et al., 2021,
<doi:10.31234/osf.io/kvsp7>; Maier, Bartoš & Wagenmakers, in press,
<doi:10.31234/osf.io/u4cns>). Users can define a wide range of non-informative
individual components (e.g., effect vs. no effect; Bartoš et al., 2022,
<doi:10.1002/jrsm.1594>; Maier, Bartoš & Wagenmakers, 2022,
<doi:10.1037/met0000405>). Users can define a wide range of non-informative
or informative prior distributions for the effect size, heterogeneity,
and publication bias components (including selection models and PET-PEESE).
The package provides convenient functions for summary, visualizations, and
Expand All @@ -40,10 +40,9 @@ NeedsCompilation: yes
Depends:
R (>= 4.0.0)
Imports:
BayesTools (>= 0.2.0),
BayesTools (>= 0.2.14),
runjags,
rjags,
coda,
stats,
graphics,
mvtnorm,
Expand All @@ -53,8 +52,11 @@ Imports:
ggplot2
Suggests:
parallel,
rstan,
metaBMA,
metafor,
weightr,
fixest,
metadat,
testthat,
vdiffr,
knitr,
Expand Down
13 changes: 13 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

S3method(plot,RoBMA)
S3method(print,RoBMA)
S3method(print,marginal_summary.RoBMA)
S3method(print,summary.RoBMA)
S3method(summary,RoBMA)
S3method(update,RoBMA)
Expand All @@ -12,29 +13,40 @@ export(OR2z)
export(RoBMA)
export(RoBMA.get_option)
export(RoBMA.options)
export(RoBMA.reg)
export(check_RoBMA)
export(check_setup)
export(check_setup.reg)
export(combine_data)
export(contr.meandif)
export(contr.orthonormal)
export(d2OR)
export(d2logOR)
export(d2r)
export(d2z)
export(diagnostics)
export(diagnostics_autocorrelation)
export(diagnostics_density)
export(diagnostics_trace)
export(dwnorm)
export(forest)
export(interpret)
export(is.RoBMA)
export(is.RoBMA.reg)
export(logOR2OR)
export(logOR2d)
export(logOR2r)
export(logOR2z)
export(marginal_plot)
export(marginal_summary)
export(n_d)
export(n_r)
export(n_z)
export(plot_models)
export(prior)
export(prior_PEESE)
export(prior_PET)
export(prior_factor)
export(prior_informed)
export(prior_none)
export(prior_weightfunction)
Expand Down Expand Up @@ -69,6 +81,7 @@ export(z2r)
importFrom(BayesTools,is.prior)
importFrom(BayesTools,is.prior.PEESE)
importFrom(BayesTools,is.prior.PET)
importFrom(BayesTools,is.prior.factor)
importFrom(BayesTools,is.prior.none)
importFrom(BayesTools,is.prior.point)
importFrom(BayesTools,is.prior.simple)
Expand Down
14 changes: 14 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## version 3.0
### Features
- meta-regression with `RoBMA.reg()` function
- posterior marginal summary and plots for the `RoBMA.reg` models with `summary_marginal()` and `plot_marginal()` functions
- new vignette on hierarchical Bayesian model-averaged meta-analysis
- new vignette on robust Bayesian model-averaged meta-regression
- adding vignette from AMPPS tutorial
- faster implementation of JAGS multivariate normal distribution (based on the BUGS JAGS module)
- incorporating `weight` argument in the `RoBMA` and `combine_data` functions in order to pass `custom` likelihood weights
- ability to use inverse square weights in the weighted meta-analysis by setting a `weighted_type = "inverse_sqrt"` argument

### Changes
- reworked interface for the hierarchical models. Prior distributions are now specified via the `priors_hierarchical` and `priors_hierarchical_null` arguments instead of `priors_rho` and `priors_rho_null`. The model summary now shows `Hierarchical` component summary.

## version 2.3.2
### Fixes
- suppressing start-up message
Expand Down
2 changes: 1 addition & 1 deletion R/RoBMA-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
##' further questions.
##'
##' @references \insertAllCited{}
##' @importFrom BayesTools is.prior is.prior.none is.prior.point is.prior.simple is.prior.PET is.prior.PEESE is.prior.weightfunction
##' @importFrom BayesTools is.prior is.prior.none is.prior.point is.prior.simple is.prior.factor is.prior.PET is.prior.PEESE is.prior.weightfunction
##' @importFrom Rdpack reprompt
##' @importFrom rlang .data
"_PACKAGE"
Expand Down
Loading

1 comment on commit 060b631

@barracuda156
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FBartos Something here has broken builds with Clang: #28

Please sign in to comment.