knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(ordinalsimr)
The {ordinalsimr} package wraps a Shiny application and supporting functions for running simulation studies on several pre-selected statistical tests applicable to ordinal data. The Shiny app is particularly suited for calculating Power and Type II error for a proposed 2-group comparison of an ordinal endpoint. Available parameters to manipulate before running the tests include:
In addition to these parameters for running the simulation, the following can be adjusted in the Distributions page
Bug reports and feature requests can be submitted as issues at https://github.com/NeuroShepherd/ordinalsimr/issues
Data downloaded after running a simulation is stored as a .rds
file, and can be loaded into your R session using readRDS()
. The data is structured as a named list with 3 elements at the top level, and several sub-elements. A summary of the available information is available in the code below.
output <- readRDS("data-2025-01-19-d8621b-1.rds") output$comparison_data$distribution_statistics str(output, max.level = 2)
comparison_data
are results from comparing Group 1 against Group 2 in the statistical tests (for TII error and power)group1_data
are results from comparing Group 1 data against itself (for TI error of this group)group2_data
are results from comparing Group 2 data against itself (for TI error of this group)run_info
are tables of detailed metainformation about the parameters used for each rundistribution_statistics
are tables of computed TII error, power, and associated confidence intervalsgroup1_t1error
and group2_t1error
are tables of TI error and associated confidence intervalsAny scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.