CRTpower {CRTspat}  R Documentation 
CRTpower
carries out power and sample size calculations for CRTs.
CRTpower(
trial = NULL,
locations = NULL,
alpha = 0.05,
desiredPower = 0.8,
effect = NULL,
yC = NULL,
outcome_type = "d",
sigma2 = NULL,
denominator = 1,
N = 1,
ICC = NULL,
cv_percent = NULL,
c = NULL,
sd_h = 0
)
trial 
dataframe or 
locations 
numeric: total number of units available for randomization (required if 
alpha 
numeric: confidence level 
desiredPower 
numeric: desired power 
effect 
numeric: required effect size 
yC 
numeric: baseline (control) value of outcome 
outcome_type 
character: with options 

sigma2 
numeric: variance of the outcome (required for 
denominator 
numeric: rate multiplier (for 
N 
numeric: mean of the denominator for proportions (for 
ICC 
numeric: Intracluster correlation 
cv_percent 
numeric: Coefficient of variation of the outcome (expressed as a percentage) 
c 
integer: number of clusters in each arm (required if 
sd_h 
standard deviation of number of units per cluster (required if 
Power and sample size calculations are for an unmatched twoarm trial. For counts
or event rate data the formula of Hayes & Bennett, 1999 is used. This requires as an input the
between cluster coefficient of variation (cv_percent
). For continuous outcomes and proportions the formulae of
Hemming et al, 2011 are used. These make use of
the intracluster correlation in the outcome (ICC
) as an input. If the coefficient of variation and not the ICC is supplied then
the intracluster correlation is computed from the coefficient of variation using the formulae
from Hayes & Moulton. If incompatible values for ICC
and cv_percent
are supplied
then the value of the ICC
is used.
The calculations do not consider any loss in power due to spillover, loss to followup etc..
If geolocations are not input then power and sample size calculations are based on the scalar input parameters.
If a trial dataframe or 'CRTsp'
object is input then this is used to determine the number of locations. If this input object
contains cluster assignments then the numbers and sizes of clusters in the input data are used to estimate the power. If buffer zones have been specified
then separate calculations are made for the core area and for the full site.
The output is an object of class 'CRTsp'
containing any input trial dataframe and values for:
The required numbers of clusters to achieve the specified power.
The design effect based on the input ICC.
Calculations of the nominal power (ignoring any bias caused by spillover, loss to followup etc.)
A list of class 'CRTsp'
object comprising the input data, cluster and arm assignments,
trial description and results of power calculations
{# Power calculations for a binary outcome without input geolocations
examplePower1 = CRTpower(locations = 3000, ICC = 0.10, effect = 0.4, alpha = 0.05,
outcome_type = 'd', desiredPower = 0.8, yC=0.35, c = 20, sd_h = 5)
summary(examplePower1)
# Power calculations for a rate outcome without input geolocations
examplePower2 = CRTpower(locations = 2000, cv_percent = 40, effect = 0.4, denominator = 2.5,
alpha = 0.05, outcome_type = 'e', desiredPower = 0.8, yC = 0.35, c = 20, sd_h=5)
summary(examplePower2)
# Example with input geolocations and randomisation
examplePower3 = CRTpower(trial = readdata('example_site.csv'), desiredPower = 0.8,
effect=0.4, yC=0.35, outcome_type = 'd', ICC = 0.05, c = 20)
summary(examplePower3)
}