geep: Generalized estimating equation power for testing a main...

View source: R/GEE_Functions.R

geepR Documentation

Generalized estimating equation power for testing a main effect of treatment given a specific sample size (N, number of clusters)

Description

Compute the power for testing a main effect of a treatment in a 2-arm parallel groups design via a 3-level generalized estimating equation with binary outcome data, given sample size (N, number of clusters).

Usage

geep(p0, p1, r, rho, n_e = 1, n_s = 1, pi_c = 0.5, alpha = 0.05, N)

Arguments

p0

A numeric value for p_0: the probability of the outcome in the control arm.

p1

A numeric value for p_1: the probability of the outcome in the treatment arm.

r

A numeric value for r: the correlation between evaluations from the same subject.

rho

A numeric value for \rho: the correlation between outcome evaluations from different subjects in the same cluster.

n_e

A numeric vector for n_e: the number of outcome evaluations per subject (level 1 observations of the binary outcome variable), which is assumed to be constant across subjects.

n_s

A numeric vector for n_s: the number of subjects (level 2 units) per cluster (i.e., the cluster size), which is assumed to be constant across clusters.

pi_c

A numeric value for \pi: the proportion of clusters in the control arm.

alpha

A numeric value for \alpha: the Type I error rate.

N

A numeric vector for the total number of clusters in the sample.

Details

=============================================================================

This function is useful for examining a range of scenarios. Using vectors with legnth > 1 for parameters such as n_s, n_e, and N will yield power estimates for multiple scenarios in the data frame returned.

Value

A data frame.

References

Teerenstra, S., Lu, B., Preisser, J. S., van Achterberg, T., & Borm, G. F. (2010). Sample size considerations for GEE analyses of three-level cluster randomized trials. Biometrics, 66(4), 1230-1237. doi:10.1111/j.1541-0420.2009.01374.x


sjpierce/piercer documentation built on Dec. 30, 2024, 3:28 p.m.