Active Dataset

Plot

Plot

Plot

Plot

Plot

Result

Plot

Table

Result

Result

Result

Welcome to the help section!

The Shiny app for Single-Case Data Analysis (Shiny SCDA) aims to makes it easy to design and analyze single-case experiments. It is possible to design single-case phase, alternation and multiple-baseline experiments, and conduct visual examination and randomization tests on data gathered by means of such designs.

This section contains information on how to use the web app. The functions in this web app are organized into the following tabs based on a natural progression of functions needed over the course of conducting a single-case experiment.

  • Design
  • Data
  • Visual Analysis
  • Randomization Test
  • Further Analysis

Inside each tab, the navigation panel on the left can be used to select a function among those available.

Once a function is selected, the parameters for the function can be set in the middle panel. The parameters displayed are dynamically generated. Hence changing one parameter may lead to changes in other parameters. Some parameters may be hidden if they are not necessary in the context of values selected for other parameters.

Once the parameters are set, clicking the button at the bottom of the parameter panel will execute the function. The output is displayed on the rightmost panel.

Please check the other tabs for information on the specific functions available.

The Design tab contains functions that help in designing a single-case experiment. The following functions can be found.

  • Number of possible assignments: The number of possible assignments for the specified design parameters is calculated. Every acceptable allocation of treatment levels to measurement occasions is a possible assignment. For example, in an experiment with 6 measurement occasions and 2 treatment levels A (baseline) and B (treatment), a possible assignment is A A A B B B, which means for the first 3 measurement occasions treatment A is applied while treatment B is applied for the next 3 measurement occasions.

  • Display all possible assignments: All assignment possibilities for the specified design parameters are enumerated. If the result is too large, it can only be saved to a file and not displayed. For Multiple Baseline Design, the possible combinations of start points for each unit are returned. There may be duplicates among these assignments if there are overlaps between the start points for different subjects. This is a result of the subjects also being randomized to the set of start points. For all other designs, the possible sequences of conditions are returned (e.g., A A A B B B).

  • Choose 1 possible assignment: One assignment is randomly selected for conducting the experiment from all theoretical assignment possibilities. For Multiple Baseline Design, a possible combination of start points for each unit is returned. For all other designs, a possible sequence of conditions is returned (e.g., A A A B B B).

The following parameters may need to be set for the functions in Design tab.

  • Select the design type: Type of single-case design. The options are AB Phase Design, ABA Phase Design, ABAB Phase Design, Completely Randomized Design, Randomized Block Design, Alternating Treatments Design, Multiple Baseline Design and User Specified Design.

  • Number of observations: Measurement times or number of observations in the experiment.

  • Minimum number of observations per phase: Only required for phase designs (AB Phase Design, ABA Phase Design and ABAB Phase Design). Minimum number of observations needed per phase (baseline or treatment).

  • Maximum number of consecutive administrations of the same condition: Only required for Alternating Treatments Design. The maximum number of consecutive administrations of the same condition (baseline or treatment) allowed.

  • Multiple Baseline Design: Select text file containing possible start points: Only required for Multiple Baseline Design. A text file containing all possible startpoints for treatment is required. In this startpoint file, each row should contain all possibilities for one unit, separated by a space or a tab. The rows and columns should not be labeled.

  • User Specified Design: Select text file containing possible assignments: Only required for User Specified Design. Text file where all the possible assignments can be found. In this file, each row should contain the sequence of conditions in one possible assignment. There should be one row for every possible assignment. The rows and columns should not be labeled.

References

Bulté, I., & Onghena, P. (2008). An R package for single-case randomization tests. Behavior Research Methods, 40, 467-478. https://doi.org/10.3758/BRM.40.2.467

Bulté, I., & Onghena, P. (2009). Randomization tests for multiple baseline designs: An extension of the SCRT-R package. Behavior Research Methods, 41, 477-485. https://doi.org/10.3758/BRM.41.2.477

The Data tab contains a function to upload the observed dataset in the web app once the experiment is completed for analysis. Once a dataset is uploaded, it is used as the default dataset for all analyses until another dataset is uploaded.

  • Set data: The observed dataset can be uploaded to the web app for analysis.

The following parameters may need to be set in the Data tab.

  • Select the design type: Type of single-case design. The options are AB Phase Design, ABA Phase Design, ABAB Phase Design, Completely Randomized Design, Randomized Block Design, Alternating Treatments Design, Multiple Baseline Design and User Specified Design.

  • Select data file: The file containing the observed data should be selected. Text files (.txt), Comma Separated Value (CSV) files (.csv), R Dataset files (.Rdata or .Rda) and Excel files (.xlx or .xlsx) are supported. The data should consist of two columns for all designs with the exception of Multiple Baseline Design; the first with the condition labels and the second with the obtained scores. For Multiple Baseline Design it should consist of these two columns for each unit. Each row in the data should represent one measurement occasion. The recommended file format is a Text file. Missing data should be indicated as NA. Example datasets: Sample AB Phase Design data, Sample ABAB Phase Design data, Sample Multiple Baseline Design data.

  • File contains column headers: Only required for Text files, Comma Separated Value files and Excel files. A checkbox which should indicate whether the input data file contains column headers (column names) or not. By default, a row containing column headers is expected for Excel and CSV files but not for Text files.

  • Sheet index number: Only required for Excel files. The sheet index number should be entered. The sheet index number represents the numeric sequence of sheets in an Excel workbook, starting with 1 on the left. By default, the first sheet is read.

  • A treatment level label and B treatment level label: Only required for AB Phase Design, Completely Randomized Design, Randomized Block Design, Alternating Treatments Design, Multiple Baseline Design and User Specified Design. These options can be used to specify the labels for baseline and treatment levels in the dataset.

  • A1 phase label, B1 phase label, A2 phase label and B2 phase label: Only required for ABA Phase Design and ABAB Phase Design. These options can be used to specify labels for the first baseline phase, the first treatment phase, the second baseline phase and the second treatment phase respectively in the dataset.

The Visual Analysis tab contains functions that help in plotting the observed data and visually analyzing a single-case experiment, by displaying central location, variability and trend. The following functions can be found.

  • Plot observed data: The observed single-case data are plotted.

  • Plot measure of central tendency: A measure of central tendency ((trimmed) mean, (broadened) median, M-estimator) is plotted as a horizontal reference line superimposed on the raw time series data.

  • Plot estimate of variability: Information about variability in the data is displayed by three methods. For all these methods, the influence of outliers may be lessened by using a trimmed range, in which only a sample of the data set is used.

    • Range bar graphs consist of a vertical line for each phase, created by connecting three points: an estimate of central tendency ((trimmed) mean, (broadened) median, M-estimator), the minimum and the maximum.
    • Range lines consist of a pair of lines parallel to the X-axis, passing through the lowest and highest values for each phase, and superimposed on the raw data.
    • Trended ranges display changes in variability within phases.
  • Plot estimate of trend: Systematic shifts in central location over time are visualized using several methods.

    • A vertical line graph plots the deviations from each data point to a measure of central tendency against time.
    • Regression lines superimpose a linear function on the raw data by means of least squares regression, the split-middle method or the resistant trend line fitting method.
    • The presence of a nonlinear trend can be displayed with running medians.
  • Plot interactive graph: The observed single-case data are plotted using plotly, a web-based interactive charting library.

The following parameters may need to be set for the functions in Visual Analysis tab.

  • Select the design type: Type of single-case design. The options are AB Phase Design, ABA Phase Design, ABAB Phase Design, Completely Randomized Design, Randomized Block Design, Alternating Treatments Design, Multiple Baseline Design and User Specified Design.

  • X-axis label: Plot X-axis label. Default is Measurement Times.

  • Y-axis label: Plot Y-axis label. Default is Scores.

  • A treatment level label and B treatment level label: Only required for AB Phase Design, Completely Randomized Design, Randomized Block Design, Alternating Treatments Design, Multiple Baseline Design and User Specified Design. These options can be used to specify the labels for baseline and treatment levels in the plot.

  • A1 phase label, B1 phase label, A2 phase label and B2 phase label: Only required for ABA Phase Design and ABAB Phase Design. These options can be used to specify labels for the first baseline phase, the first treatment phase, the second baseline phase and the second treatment phase respectively in the plot.

  • Y-axis minimum and Y-axis maximum: Y-axis range: Y-axis minimum limit and Y-axis maximum limit respectively. If left empty, they will be inferred from the data. The values are co-dependent, hence either both should be left empty, or both should be assigned a value.

  • Legend X-coord and Legend X-coord: Only required for certain plots of Completely Randomized Design, Randomized Block Design, Alternating Treatments Design and User Specified Design. Legend location within plot: the X-coordinate and Y-coordinate for the top left corner of the legend can be specified.

  • Select the measure of central tendency: Measure of central tendency. The options are Mean, Median, Broadened median, Trimmed mean and M-estimator.

  • Trimmed mean: Proportion of observations to be removed: Only required if Trimmed mean is selected as the measure of central tendency. The percentage of observations that has to be removed from the end of the distribution before computing the mean. It can be any value from 0 (regular arithmetic mean) to 0.5. Usually 20 percent of the observations is trimmed, so default is 0.2.

  • M-estimator: Value for the constant K: Only required if M-estimator is selected as the measure of central tendency. The desired value for the constant K for M-estimator. Usually a percentile of the standard normal distribution is chosen. Default is 1.28, which corresponds to the 90th percentile of the standard normal distribution and covers 80 percent of the underlying distribution. For the calculation of the M-estimator, the function mest(x, bend = 1.28) from Wilcox (2005) is used.

  • Select the measure of variability: Only required for function Plot estimate of variability. Estimate of variability. The options are Range lines, Range bars and Trended range.

  • Remove extreme values?: Only required for function Plot estimate of variability. Reduce the influence of outliers by removing the 10-20 percent extreme values from each treatment level or use the whole dataset. Default is to use the whole dataset.

  • Select the trend visualization: Only required for function Plot estimate of trend. Trend visualization. The options are Vertical line plot; trend lines by means of least squares regression (Trend lines (Least Squares regression)), split-middle method (Trend lines (Split-middle)), resistant trend line fitting (Trend lines (Resistant trend line fitting)); and running medians depending on the desired batch size (Running medians (batch size 3), Running medians (batch size 5), Running medians (batch size 4 averaged by pairs)).

References

Bulté, I., & Onghena, P. (2012). When the truth hits you between the eyes: A software tool for the visual analysis of single-case experimental data. Methodology, 8, 104-114. https://doi.org/10.1027/1614-2241/a000042

Wilcox, R.R. (2005). Introduction to robust estimation and hypothesis testing (2nd ed.). San Diego, CA: Elsevier Academic Press.

The Randomization Test tab contains functions that help in statistically analyzing a single-case experiment by conducting randomization tests on observed data. The following functions can be found.

  • Observed test statistic: The observed test statistic is calculated from the obtained raw data.

  • Randomization distribution: The randomization distribution is generated by a complete enumeration of all assignment possibilities or by a random sample of all assignment possibilities. The distribution is displayed as a vector and as a histogram (in which the observed test statistic is also marked). When there are missing data, randomization distribution is generated as usual, but instead of randomly reshuffling numerical scores only, the missing data markers (NA) are also included in the reshuffling. For test statistic calculations, missing data are omitted.

  • P-value: The p-value corresponding to the observed value of the test statistic is obtained by locating this value in the randomization distribution generated by a complete enumeration of all assignment possibilities or by a random sample of all assignment possibilities. If test statistic cannot be calculated for a particular randomization due to missing data for a treatment condition, the test statistic from this randomization is conservatively considered more extreme than the observed test statistic.

The following parameters may need to be set for the functions in Randomization Test tab.

  • Select the design type: Type of single-case design. The options are AB Phase Design, ABA Phase Design, ABAB Phase Design, Completely Randomized Design, Randomized Block Design, Alternating Treatments Design, Multiple Baseline Design and User Specified Design.

  • Minimum number of observations per phase: Only required for phase designs (AB Phase Design, ABA Phase Design and ABAB Phase Design). Minimum number of observations needed per phase (baseline or treatment).

  • Maximum number of consecutive administrations of the same condition: Only required for Alternating Treatments Design. The maximum number of consecutive administrations of the same condition (baseline or treatment) allowed.

  • Multiple Baseline Design: Select text file containing possible start points: Only required for Multiple Baseline Design. A text file containing all possible startpoints for treatment is required. In this startpoint file, each row should contain all possibilities for one unit, separated by a space or a tab. The rows and columns should not be labeled.

  • User Specified Design: Select text file containing possible assignments: Only required for User Specified Design. Text file where all the possible assignments can be found. In this file, each row should contain the sequence of conditions in one possible assignment. There should be one row for every possible assignment. The rows and columns should not be labeled.

  • Select the test statistic: Test statistic. For AB Phase Design, Completely Randomized Design, Randomized Block Design, Alternating Treatments Design, Multiple Baseline Design and User Specified Design, there are 3 built-in possibilities: A-B, B-A, and |A-B|, which stand for the (absolute value of the) difference between condition means. For phase designs with more than 2 phases (ABA Phase Design and ABAB Phase Design), 3 more built-in options are available: PA-PB, PB-PA, and |PA-PB| refer to the (absolute value of the) difference between the means of phase means. Additionally, it is possible to specify a Custom test statistic.

  • Define test statistic: Only required if Custom test statistic is selected. Any test statistic can be specified using the variable identifiers A and B (or in the case of ABA Phase Design and ABAB Phase Design, A1, B1, A2, B2, A and B) and any of the basic R functions. For example, abs(mean(A) - mean(B)) can be specified as a test statistic and it is the same as selecting |A-B|.

  • Select the randomization distribution: Type of randomization distribution. The options are Systematic randomization distribution (exhaustive randomization distribution generated by a complete enumeration of all assignment possibilities) and Monte Carlo randomization distribution (nonexhaustive randomization distribution generated by a random sample of all assignment possibilities). Please note that the randomization distribution generated by Monte Carlo randomization distribution may not be the same as that generated by Systematic randomization distribution, consequently the p-values calculated by the two methods may not be equal. For designs resulting in a very large number of possible assignments, to ensure reasonable computation times in the web app, it may only be possible to calculate a Monte Carlo randomization distribution.

  • Monte Carlo: Number of randomizations: Only required if Monte Carlo randomization distribution is selected. Number of randomizations required. Please note that the observed test statistic is always included in the randomization distribution. To ensure reasonable computation times in the web app, the maximum number of Monte Carlo randomizations allowed is restricted based on the design.

References

Bulté, I., & Onghena, P. (2008). An R package for single-case randomization tests. Behavior Research Methods, 40, 467-478. https://doi.org/10.3758/BRM.40.2.467

Bulté, I., & Onghena, P. (2009). Randomization tests for multiple baseline designs: An extension of the SCRT-R package. Behavior Research Methods, 41, 477-485. https://doi.org/10.3758/BRM.41.2.477

De, T. K., Michiels, B., Tanious, R., & Onghena, P. (2020). Handling missing data in randomization tests for single-case experiments: A simulation study. Behavior Research Methods, 52(3), 1355–1370. https://doi.org/10.3758/s13428-019-01320-3

Edgington, E.S., & Onghena, P. (2007). Randomization tests (4th ed.). Boca Raton, FL: Chapman & Hall/CRC.

Hope, A.C.A. (1968). A simplified Monte Carlo significance test procedure. Journal of the Royal Statistical Society, Series B 30, 582-598.

The Further Analysis tab contains functions that help in further analysis of single-case experiments, including calculating various effect size measures and probability combining (additive and multiplicative method). The following functions can be found.

  • Calculate effect size measure: The specified effect size measure is calculated.

  • Combine p-values: A general p-value is calculated, by statistically combining the p-values of a number of independent studies, to test the null hypothesis that the result of every included study is insignificant as opposed to the alternate hypothesis that at least one of them contain a significant result.

The following parameters may need to be set for the functions in Further Analysis tab.

  • Select the design type: Only required for function Calculate effect size. Type of single-case design. The options are AB Phase Design, ABA Phase Design, ABAB Phase Design, Completely Randomized Design, Randomized Block Design, Alternating Treatments Design, Multiple Baseline Design and User Specified Design.

  • Select the effect size measure: Only required for function Calculate effect size measure. The measure of effect size that has to be calculated. The options are Standardized Mean Difference, Pooled Standardized Mean Difference, PND (expected increase) / PND (expected decrease) (percentage of nonoverlapping data, depending on the expected direction of the treatment effect), PEM (expected increase) / PEM (expected decrease) (percentage of data points exceeding the median, depending on the expected direction of the treatment effect), and NAP (expected increase) / NAP (expected decrease) (nonoverlap of all pairs, depending on the expected direction of the treatment effect).

  • Select the combining method: Only required for function Combine p-values. Indicates which combining function should be used. The options are Multiplicative and Additive. The combined p-value is calculated as the probability of getting a product (or sum) of p-values as small as the product (or sum) of the actual observed p-values from the studies under consideration.

  • Select text file containing p-values: Only required for function Combine p-values. Text file in which the p-values can be found. This text file should consist of one column with all the obtained p-values. Example input file: Sample p-values.

References

Bulté, I., & Onghena, P. (2013). The Single-Case Data Analysis package: Analysing single-case experiments with R software. Journal of Modern Applied Statistical Methods, 12, 450-478.

Developed by:

Methodology of Educational Sciences Research Group and Health Psychology
Faculty of Psychology and Educational Sciences
KU Leuven

Documentation:

Detailed information regarding the functions implemented in this application can be found in SCRT, SCVA and SCMA R packages.

Sample data:

Sample AB Phase Design data
Sample ABAB Phase Design data
Sample Multiple Baseline Design data
Sample p-values

Acknowledgement:

This research is supported by the Asthenes long-term structural funding - Methusalem grant (nr. METH/15/011) by the Flemish Government, Belgium.

Reference to this app:

De , T.K., Michiels, B., Vlaeyen, J.W.S., & Onghena, P. (2020). Shiny SCDA [Computer software]. Retrieved from https://ppw.kuleuven.be/mesrg/software-and-apps/shiny-scda

License:

GPL (>= 2)

Contacts:

Tamal Kumar De
Patrick Onghena