# List of all parameters
parameters = list()
# Endpoint type
parameters$endpoint_type = "Binary"
# Direction of favorable outcome
parameters$direction = "Lower"
# Number of completers in the trial arms (control, multiple treatments)
parameters$sample_size = c(100, 100)
# Cluster scheme (fixed or random cluster sizes)
parameters$cluster_scheme = "Fixed"
# Vector of cluster sizes in the control arm
parameters$control_cluster_size = rep(10, 10)
# Vector of cluster sizes in the treatment arm
parameters$treatment_cluster_size = rep(10, 10)
# Response rate in the control arm
parameters$control_rate = 0.6
# Intracluster correlation coefficient in the control arm
parameters$control_icc = 0.3
# Response rate in the treatment arms
parameters$treatment_rate = 0.3
# Intracluster correlation coefficient in the treatment arms
parameters$treatment_icc = 0.3
# Data analysis method (generalized estimating equations (GEE)
# or generalized linear mixed effects model (GLMEM))
parameters$method_type = "GLMEM"
# One-sided alpha level
parameters$alpha = 0.025
# Number of simulations
parameters$nsims = 10
# Number of cores for parallel calculations
parameters$ncores = 1
# Run simulations to compute operating characteristics
results = ClustRand(parameters)
# Generate a simulation report (remove tempfile)
GenerateReport(results,
tempfile("ClustRand Binary endpoint.docx", fileext=".docx"))
Run the code above in your browser using DataLab