Learn R Programming

mmibain

The Mighty Metrika Interface to BAIN (‘mmibain’) R package provides Shiny apps to explore basic functionality of the ‘bain’ package for BAyesian INformative Hypotheses Evaluation.

Installation

You can install the released version of ‘mmibain’ from CRAN:

install.packages("mmibain")

You can install the development version of ‘mmibain’ from GitHub with:

# install.packages("devtools")
devtools::install_github("mightymetrika/mmibain")

Play RepliCrisis

‘RepliCrisis’ is a Shiny app game that simulates evalutating replication studies based on the framework presented in Hoijtink, Mulder, van Lissa & Gu (2019). Follow these steps to play:

  • Set your sample size (for groups within study), difficulty, alpha level, and seed for reproducibility.
  • Define thresholds for the Bayes Factor and Posterior Model Probability to assess evidence in favor of the original study.
  • Conduct the original study to generate data and form a hypothesis.
  • Show diagnostics and descriptives to understand statistical results and hypotheses.
  • Conduct a replication study, using swap controls to match the original study’s results.
  • Run replication analysis to evaluate the results against the original hypothesis.
  • Start a new game by conducting a new original study.

To play, load ‘mmibain’ and call the RepliCrisis() function:

library(mmibain)
RepliCrisis()

mmibain Shiny App

The package also includes a Shiny app for running basic bain::bain() models:

  • Upload your data in CSV format.
  • Choose your modeling engine (lm, t_test, lavaan).
  • Input your model and any additional arguments.
  • Fit the model and input hypotheses for evaluation.
  • Adjust settings such as the fraction parameter, standardized regression coefficients, and confidence intervals.
  • Set a seed for reproducible results.
  • Run the Bayesian Informative Hypotheses Evaluation.

Launch the app with:

mmibain()

References

Hoijtink, H., Mulder, J., van Lissa, C., & Gu, X. (2019). A tutorial on testing hypotheses using the Bayes factor. Psychological methods, 24(5), 539–556. https://doi.org/10.1037/met0000201

Copy Link

Version

Install

install.packages('mmibain')

Monthly Downloads

164

Version

0.2.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Mackson Ncube

Last Published

May 23rd, 2024

Functions in mmibain (0.2.0)

generate_study_data

Generate Study Data for RepliCrisis
RepliCrisis

RepliCrisis Shiny App
mmib_model

Fit Statistical Models for MMI Bain Processing
mmibain

mmibain Shiny App
deal_cards_to_rc_grid

Deal Cards to a RepliCrisis Grid
BFfe

Shiny Application for Setting Up and Running Bayes Factors for Each Participant
BF_for_everyone

Compute Bayes Factors for Each Participant and Summarize Results
interpret_replication_results

Interpretation of Replication Study Results
generate_Ho_from_pairwise_t

Generate Null Hypothesis from Pairwise t-test Results
process_original_study

Process Original Study Data for Analysis
swapper

Card Matrix Swapping Function
process_replication_study

Process Replication Study Data
render_card_grid

Render Card Grid for Shiny App
generate_descriptives

Generate Descriptive Statistics for Study Groups
str2list

Convert a Character String to a List