contact@mightymetrika.com

scdtb Raw Data Plot Part 1

May 13, 2024

Building Raw Data Plots with scdtb

This blog will show you how to produce single case design raw data plots using the scdtb app. The blog post will focus on single case design plots that can be found in the What Works Clearinghouse Procedures and Standards Handbook, Version 5.0.

Basic Single-Case Design

The first example is for the single-case design data presented in Figure 14 of the WWC 5.0:




An approximation of this data is stored in the scdtb R package as the 'basic_scd' dataset.




The write.csv R function was used to create the csv file used in this example. You can download this dataset using the button below.



To get started, got to mightymetrika.com click on Tools then click on scdtb to open the Single Case Design Tool Box app. Next, upload the basic_scd.csv dataset by clicking BROWSE..., navigating to the basic_scd.csv file, clicking on the file, then clicking Open. Once the data finishes uploading, you should see the screen below.



Note that, 'X' is the "row number" variable which is in the dataset due to my using write.csv default settings. We will ignore this variable.


To produce a plot similar to WWC 5.0 Figure 14, simply:

  • Enter socbehavs as the Outcome Variable
  • Enter time as the Time Variable
  • Enter phase as the Phase Variable
  • Click PLOT DATA


After following these steps, you should see the screen below.




While this plot should allow one to draw the same conclusions as would be drawn from the WWC 5.0 Figure 14, it shows a few improvements which should be made in the next release of the scdtb R package. First, the values of time displayed on the x-axis should be selected more thoughtfully so that users can quickly see which time point each data point corresponds to. Another major difference is that in the scdtb app, a line connects the data points across the phase line. I'm not sure if this presents any problems, but if you would like to see this (or any other aspect of the app) changed in future editions, please submit an issue to the package's github.



Reversal/withdrawal Design

The next example is for the reversal/withdrawal design. This example is based on Figure 17 of WWC 5.0:




An approximation of this data is stored in the "reversal_withdrawal" dataset of the scdtb R package. View and download this data below.


As in the previous example, we start by opening the scdtb app:


Once the app is open, upload the  reversal_withdrawal.csv:

  • BROWSE...
  • navigating to the reversal_withdrawal.csv file
  • Click on file
  • Click Open.


If all went well, you should see the screen below.




Plotting this data is very similar to the previous example. You can produce a plot like WWC 5.0 Figure 17 by:


  • Enter extbehavs as the Outcome Variable
  • Enter time as the Time Variable
  • Enter phase as the Phase Variable
  • Click PLOT DATA



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: