cps.irgtt.binary: Simulation-based power estimation for binary outcome...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/cps.irgtt.binary.R

Description

This function utilizes iterative simulations to determine approximate power for individually randomized group treatment trials. Users can modify a variety of parameters to suit the simulations to their desired experimental situation.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
cps.irgtt.binary(
  nsim = NULL,
  nsubjects = NULL,
  nclusters = NULL,
  p1 = NULL,
  p2 = NULL,
  sigma_b_sq = 0,
  sigma_b_sq2 = 0,
  alpha = 0.05,
  quiet = TRUE,
  allSimData = FALSE,
  poorFitOverride = FALSE,
  lowPowerOverride = FALSE,
  timelimitOverride = TRUE,
  nofit = FALSE,
  seed = NA
)

Arguments

nsim

Number of datasets to simulate; accepts integer (required).

nsubjects

Number of subjects per cluster in the clustered (arm 2) group; accepts integer (required).

nclusters

Number of clusters per arm; accepts integer (required).

p1

Expected probability of outcome in arm 1 (required)

p2

Expected probability of outcome in arm 2 (required)

sigma_b_sq

Between-cluster variance; defaults to 0. Accepts numeric.

sigma_b_sq2

Between-cluster variance for clusters in arm 2.

alpha

Significance level; default = 0.05

quiet

When set to FALSE, displays simulation progress and estimated completion time, default is TRUE.

allSimData

Option to output list of all simulated datasets; default = FALSE.

poorFitOverride

Option to override stop() if more than 25% of fits fail to converge; default = FALSE.

lowPowerOverride

Option to override stop() if the power is less than 0.5 after the first 50 simulations and every ten simulations thereafter. On function execution stop, the actual power is printed in the stop message. Default = FALSE. When TRUE, this check is ignored and the calculated power is returned regardless of value.

timelimitOverride

Logical. When FALSE, stops execution if the estimated completion time is more than 2 minutes. Defaults to TRUE.

nofit

Option to skip model fitting and analysis and return the simulated data. Defaults to FALSE.

seed

Option to set seed. Default is NA.

Details

Runs the power simulation for binary outcomes.

Users must specify the desired number of simulations, number of subjects per cluster, number of clusters per arm, two of the following three terms: expected probability of outcome in arm 1, expected probability of outcome in arm 2, expected difference in probabilities between groups; significance level, progress updates, and simulated data set output may also be specified.

Value

A list with the following components

If nofit = T, a data frame of the simulated data sets, containing:

Author(s)

Alexandria C. Sakrejda (acbro0@umass.edu)

Alexander R. Bogdan

Ken Kleinman (ken.kleinman@gmail.com)

References

Snjiders, T. & Bosker, R. Multilevel Analysis: an Introduction to Basic and Advanced Multilevel Modelling. London, 1999: Sage.

Eldridge, S., Ukoumunne, O. & Carlin, J. The Intra-Cluster Correlation Coefficient in Cluster Randomized Trials: A Review of Definitions. International Statistical Review (2009), 77, 3, 378-394. doi: 10.1111/j.1751-5823.2009.00092.x

Examples

1
2
3
4
5
6
7
## Not run: 
irgtt.binary.sim <- cps.irgtt.binary(nsim = 100, nsubjects = c(150, 30), 
                        nclusters = 10, p1 = 0.44,
                        p2 = 0.2, sigma_b_sq2 = 1, alpha = 0.05, 
                        allSimData = FALSE)

## End(Not run)

nickreich/clusterPower documentation built on Feb. 3, 2021, 6:54 p.m.