contact@mightymetrika.com

mmibain 0.2.0 Release Party

May 27, 2024

mmibain 0.2.0 is now available on CRAN: https://CRAN.R-project.org/package=mmibain. The updated package has a new function and a corresponding app.



BF_for_everyone()

The Bayes Factors for Everyone, BF_for_everyone(), function is a function which based on the work of Fayette Klaassen's Combining Evidence Over Multiple Individual Analyses:


"This chapter presents a Bayesian method to evaluate hypotheses for each person in a sample and aggregate this result to answer the question whether a hypothesis holds for everyone in the sample, rather than on average."


The main workhorse of the method is Bayesian Informative Hypothesis Testing which you can learn more about on the bain website as well as in Mighty Metrika's Quick mmibain Tutorial blog post.


The method is special because it combines two major methods that often show up in the small sample size statistics literature and on mightymetrika.com:




Informative hypothesis testing is a valuable method in small sample size statistics because when a researcher specifies hypotheses based on their expectations gleaned through experience in their field, "power can be gained and inherently a smaller sample size is needed."


Case-by-case methods are are important in situation where the data generating method suggests that standard errors might be off due to lack of independent observations but there is not enough data to trust traditional methods (such as mixed effects models and cluster robust standard errors). Also, as stated in Klaassen's book chapter, case-by-case methods can also be important when you want to know if the hypothesis holds for each person in the sample.


The basic workflow for BF_for_everyone() is the following:

  1. Fit a stats::lm linear model for each participant
  2. Specify a hypothesis for bain
  3. Use the fitted linear model and bain hypothesis to fit a bain model for each participant
  4. Present Bayes Factors for each participant
  5. Aggregate Bayes Factors by presenting the
  6. gPBF
  7. Evidence Rate
  8. Stability Rate


These aggregate measures are described as follows in Klaassen's chapter:




The version of BF_for_everyone() function that's available in mmibain 0.2.0 only allows using stats::lm as the underlying statistical model. Future versions of mmibain might strive to include a richer set of statistical models given the flexibility of the 'bain' R package and the flexibility of the Bayesian informative hypothesis testing framework.

BFfe()

As is standard in Mighty Metrika software, the exported functions which represent the central statistical methods get their own Shiny application. The BFfe() function is the Shiny application which can be used to run the BF_for_everyone() function on csv data. To access the application online, go to https://www.mightymetrika.com/tools and click the BFfe button.


A quick tutorial on the BFfe application is coming up in the next few weeks.

August 19, 2024
Mighty Metrika focuses on statistical methods and mathematics for the analysis of small sample size data. As such, the project runs the risk of people with small sample sizes using tools and methods from mightymetrika.com and becoming over confident in their results because they used "small sample size methods." The long term rigorous goal to combat this disservice is to host citizen science projects, include simulation function in R packages, and share simulation results from the literature and from mightymetrika.com tools through blogs. A short and quick way to combat misuse is through the Who Said It Best series. The series will share some of the best warnings from the small sample size statistical literature. In the Conclusion section of Daniel McNeish's paper Challenging Conventional Wisdom for Multivariate Statistical Models With Small Samples he shares a clear and wonderfully worded warning:
June 25, 2024
This is a quick blog post to list some of the essential resources that I needed to get a citizen science app up and running. The app uses: R Shiny PostgreSQL Pool AWS EC2 The post is basically a way for me to bookmark resources that I found useful and also as a way to say thank you to the folks that put these resources up online.
June 10, 2024
In 'mmibain' v0.2.0, the unit tests are passing at the moment, but on r-devel-linux-x86_64-debian-clang it really seems to be hit or miss. I believe that when the test fails it is do to the new BFfe function which is a case-by-case type implementation of ' bain ' for linear models; however, I used a unit test which relies on a synthetic data set where I generated random numbers and then just used the rep() function to group observations by participants. As such, the data generating process does fit the statistical model and sometimes the random data set that is generated does not make it through bain::bain() without error. I have already changed the unit test and corresponding Roxygen2 documentation example on the Mighty Metrika GitHub and this blog post will walk through the new data and model. But just for further context, here is the original code that sometimes runs through and sometimes throws and error.
More Posts
Share by: