Learn R Programming

clusterPower (version 0.7.0)

cpa.irgtt.normal: Power calculations for individually randomized group treatment trials, continuous outcome

Description

Compute the power of an individually randomized group treatment trial (IRGTT) design with a continuous outcome, or determine parameters to obtain a target power.

Usage

cpa.irgtt.normal(
  alpha = 0.05,
  power = 0.8,
  nclusters = NA,
  nsubjects = NA,
  ncontrols = NA,
  d = NA,
  varu = NA,
  varei = NA,
  varr = NA,
  tol = .Machine$double.eps^0.25
)

Arguments

alpha

The level of significance of the test, the probability of a Type I error.

power

The power of the test, 1 minus the probability of a Type II error.

nclusters

The number of clusters in the intervention arm.

nsubjects

The number of subjects in each cluster in the intervention arm.

ncontrols

The number of subjects in the control arm.

d

The expected treatment effect.

varu

The variance of the cluster level random effect for clusters in the intervention arm.

varei

The variance of the subject level random error for individuals in the intervention arm.

varr

The variance of the subject level random error for individuals in the control arm.

tol

Numerical tolerance used in root finding. The default provides at least four significant digits.

Value

The computed argument.

Authors

Jonathan Moyer (jon.moyer@gmail.com), Ken Kleinman (ken.kleinman@gmail.com)

Details

Exactly one of alpha, power, nclusters, nsubjects, ncontrols, d, varu, varei, and varr must be passed as NA. Note that alpha and power have non-NA defaults, so if those are the parameters of interest they must be explicitly passed as NA.

References

Moerbeek, M. and Wong, W. K. (2008) Sample size formulae for trials comparing group and individual treatments in a multilevel model. Statist. Med., 27:2850-2864. doi: 10.1002/sim.3115.

Examples

Run this code
# NOT RUN {
# Find the required number of control subjects for an IRGTT with alpha = 0.05, power = 0.80,
# nclusters = 10, nsubjects = 10, d = 0.5 units, 
# varu = 0.1, varei = 0.9, varr = 1.
cpa.irgtt.normal(nclusters=10, nsubjects = 10, 
  d = 0.5, varu = 0.1, varei = 0.9, varr = 1)
# 
# The result, ncontrols = 77.81084, suggests 78 subjects in the control arm should be recruited.
# This means that the total number of subjects in the 
# study is nclusters*nsubjects + ncontrols = 10*10 + 78 = 178.

# }

Run the code above in your browser using DataLab