Learn R Programming

gap (version 1.0-14)

pbsize2: Power for case-control association design

Description

This is a revised version of pbsize which is appropriate for a case-control design under a range of disease models. Essentially, for given sample size(s), a proportion of which (fc) being cases, the function calculates power estimate for a given type I error (alpha), genotype relative risk (gamma), frequency of the risk allele (p), the prevalence of disease in the population (kp) and optionally a disease model (model). A major difference would be the consideration of case/control ascertainment neither in pbsize nor power.casectrl.

Internally, the function applies a rescaling to make the disease model consistent as in tscc and should produce accurate power estimate. Note it provides power estimates for given sample size(s) only.

Usage

pbsize2(N,fc=0.5,alpha=0.05,gamma=4.5,p=0.15,kp=0.1,model="multiplicative")

Arguments

N
The sample size
fc
The proportion of cases in the sample
alpha
Type I error rate
gamma
The genotype relative risk (GRR)
p
Frequency of the risk allele
kp
The prevalence of disease in the population
model
Disease model, i.e., "multiplicative","additive","dominant","recessive"

Value

  • The returned value is the power for the specified design.

See Also

The design follows that of pbsize and power.casectrl.

Examples

Run this code
library(genetics)

# single calc
m <- c("multiplicative","recessive","dominant")
for(i in 1:3)
{
  print(pbsize2(N=50,alpha=5e-2,gamma=1.1,p=0.1,kp=0.1, model=m[i]))
  print(power.casectrl(p=0.1, N=50, gamma=1.1, kp=.1, alpha=5e-2, minh=m[i]))
}

# for a range of sample sizes
pbsize2(p=0.1, N=c(25,50,100,200,500), gamma=1.1, kp=.1,
              alpha=5e-2, model='r')
power.casectrl(p=0.1, N=c(25,50,100,200,500), gamma=1.1, kp=.1,
              alpha=5e-2, minh='r')
   
# create a power table
f <- function(p)
  power.casectrl(p=p, N=seq(100,1000,by=100), gamma=1.1, kp=.1,
                alpha=5e-2, minh='recessive')
 
m <- sapply( X=seq(0.1,0.9, by=0.1), f)
colnames(m) <- seq(0.1,0.9, by=0.1)
rownames(m) <- seq(100,1000,by=100)
print(round(m,2))

f2 <- function(p)     
  pbsize2(p=p, N=seq(100,1000,by=100), gamma=1.1, kp=.1,
                alpha=5e-2, model='recessive')

m <- sapply( X=seq(0.1,0.9, by=0.1), f2)
colnames(m) <- seq(0.1,0.9, by=0.1)
rownames(m) <- seq(100,1000,by=100)
print(round(m,2))

Run the code above in your browser using DataLab