Name Last modified Size Description
Parent Directory - ExampleCovidTrial.pptx 2020-04-23 13:49 169K example_2arm_Fixed_Ordinal_JAGS.R 2020-04-23 13:51 12K example_2arm_Fixed_Ordinal_stan.R 2020-04-22 11:37 14K example_2arm_Fixed_Ordinal_stanarm.R 2020-04-23 13:34 11K run_example_2armFixed.R 2020-04-23 13:53 1.7K
This folder includes R code for power calculations for a two-arm trial with an ordinal endpoint. This particular example is for an 8-point ordinal outcome, but the code will work for any number of ordinal outcome levels. We model the endpoint with a Bayesian cumulative logistic model. Additional details on the trial design are given in the ExampleCovidTrial.pptx slides.
The file “run_example_2armFixed.R” includes an example power calculation based on the simulation code.
There are three files that include trial simulation code.
- We recommend using the file “example_2arm_Fixed_Ordinal_stanarm.R” to begin because it is the fastest. This code uses the stan_polr function in the rstanarm package.
- We also provide a Stan model/code in the “example_2arm_Fixed_Ordinal_stan.R” file.
- Finally, we provide a JAGS model in the “example_2arm_Fixed_Ordinal_JAGS.R” file.
The Stan/JAGS models are the most flexible — they can be modified to include covariates, random effects, alternative priors, etc.