contact@mightymetrika.com

scdtb Release Party

May 6, 2024

Single Case Design Toolbox

When I Google "randomized controlled trial gold standard", one of the first resources that pops up is Randomised controlled trials—the gold standard for effectiveness research:

In the world of education research, RCTs are one of the research designs that can attain a rating of Meets WWC Standards Without Reservations. Another research design that can attain this rating is the single case design. Single case designs are "experiments in which one unit is observed repeatedly during a certain period of time under different levels of at least one manipulated variable." When it is not possible to get enough participants to demonstrate causal effects with a well-powered RCT, researchers might try to see if it is possible to demonstrate causal effects using one (or a few) participant(s) in a single case design.


The 'scdtb' (Single Case Design Toolbox) R package has a collection of functions which can be used to visualize and analyze data from single case designs. The main functions include:


  • raw_plot(), for visualizing raw data from different types of single case designs
  • nap(), for computing the nonoverlap of all pairs
  • mixed_model_analysis(), for running a type of mixed effects model that is useful for single case designs
  • cross_lagged(), to analyze cross lagged correlations
  • randomization_test, to compare observed outcome differences to a distribution of differences obtained through permutation


All of these tools in 'scdtb' v0.1.0 were obtained or modified from the What Works Clearing House Procedures and Standards Handbook Version 5.0 or from the n=1 section of Small Sample Size Solutions. The 'scdtb' package also contains datasets that were used as examples in these two resources.


The 'scdtb' package also contains two 'shiny' applications. The first can be accessed through the scdtb() function. It can also be accessed through the mightymetrika website. This function allows the user to upload a csv file with single case design data. Once data is uploaded to the application, the user can run an analysis using the five functions mentioned above (although for a specific design, only a subset of the functions might be applicable). In the coming weeks, there will be additional blog posts outlining how to use the scdtb() 'shiny' app to analyze single case design data using the datasets contained in the 'scdtb' package.


The napjack() function is a card game to help users get a better feel for looking at analysis results from single case designs. The Roxygen2 documentation for the game describes the game as follows:


The game consists of four phases: baseline 1, treatment 1, baseline 2, and treatment 2. In each phase, the player deals six cards and has the option to swap cards within a row once per phase. After all four phases are completed, the game is scored based on the analysis of the dealt cards using non-overlap of all pairs (NAP) and mixed effects modeling.


An upcoming blog post play and explain a few hands of napjack.

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: