cpa.irgtt.normal: Power calculations for individually randomized group...

Description Usage Arguments Details Value Note Authors References Examples

View source: R/cpa.irgtt.normal.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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.

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.

Value

The computed argument.

Note

This function was inspired by work from Stephane Champely (pwr.t.test) and Peter Dalgaard (power.t.test). As with those functions, 'uniroot' is used to solve power equation for unknowns, so you may see errors from it, notably about inability to bracket the root when invalid arguments are given.

Authors

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

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

1
2
3
4
5
6
7
8
9
# 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.

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