version 13 clear all set more off *** INPUT PARAMETERS *** ******************************************************************************** local rho = 0.032 // <--- INPUT Estimate of the within-cluster within-period correlation local eta = 0.028 // <--- INPUT Estimate of the within-cluster between-period correlation local sigma_t = 1.2 // <--- INPUT Estimate of standard deviation of outcome data local m = 200 // <--- INPUT number of patients PER CLUSTER-PERIOD local diff = 0.1 // <--- INPUT treatment difference local za = 1.96 // Type I error rate 5% (To replicate paper values, set to 1.96) local zb = 0.84 // Power 80% (To replicate paper values, set to 0.84) /* local za = invnormal(0.975) // Type I error rate 5% local zb = invnormal(0.8) // Power 80% */ ******************************************************************************** * CALCULATIONS * Individually Randomised Controlled Trial local irct = 2 * (`za'+`zb')^2 * ( (2*(`sigma_t')^2) / (`diff')^2 ) * (1-`rho') local irct_clusters = `irct' / `m' * Cluster Randomised Controlled Trial local crct = 2 * (`za'+`zb')^2 * ( (2*(`sigma_t')^2) / (`diff')^2 ) * (1+(`m'-1)*`rho') + 2*`m' local crct_clusters = `crct' / `m' * Cluster Randomised Crossover Trial local crxo = 2 *(`za'+`zb')^2 * ( (2*(`sigma_t')^2) / (`diff')^2 ) * (1+(`m'-1)*`rho'-`m'*`eta') + 4*`m' local crxo_clusters = `crxo' / (2 * `m') ********************************************************************************* * OUTPUT * Individually Randomised Controlled Trial * Number of required individuals: di ceil(`irct') * Number of required clusters: di ceil(`irct_clusters') * Cluster Randomised Controlled Trial * Number of required individuals: di ceil(`crct') * Number of required clusters: di ceil(`crct_clusters') * Cluster Randomised Crossover Trial * Number of required individuals: di ceil(`crxo') * Number of required clusters: di ceil(`crxo_clusters') exit