Software Documentation
Iuliana Ionita-Laza (ii2135@columbia.edu)
This document describes the use of the accompanying R code that implements the methods described in Ionita-Laza and Ottman (2011). The code is useful in comparing theperformance of various affected-relative pair designs as well as designs based on unrelated
individuals in the context of association studies with rare variants. There are two versionsof the code, depending on the measure used to assess the performance:
1. Expected P-value: software EPV.R
2. Power: software Power.R
Tu run the code type: source(software EPV.R) or source(software Power.R). There areseveral main functions that one could use:
1. Function ‘EPV pairs(f,r,k,nnn,fi,lambda s)’ returns the expected P-value for a study
with– nnn = # pairs of affected relatives– fi=1/4 for sibs, fi=1/16 for first cousins, fi=1/64 for second cousins, fi=0 for
unrelateds– variant frequency f– genotype relative risk r– population prevalence k– sibling recurrence risk ratio lambda s.
2. Function ‘EPV one pairs(f,r,k,nnn,fi,lambda s)’ is similar with the only difference thatnnn now represents the number of affected individuals with a known affected relative.
3. Function ‘EPV pairs aggregate(f,r,nd,k,nnn,fi,lambda s)’ calculates the expected Pvalue at a locus with nd variants whose frequencies and GRRs are given in vectors
f and r.
4. Function ‘EPV one pairs aggregate(f,r,nd,k,nnn,fi,lambda s)’ is as in [3.] only thatnnn represents the number of affected individuals with a known affected relative.

1

Similar functions are defined if Power (rather than EPV) is desired. For power an alphalevel needs to be specified. Note that, since we assume that the frequency in the population
is known, the resulting power levels need to be regarded as achievable when the number ofcontrols grows large. The corresponding functions are:
1. Power pairs(f,r,k,nnn,fi,lambda s,alpha level)
2. Power one pairs(f,r,k,nnn,fi,lambda s,alpha level)
3. Power pairs aggregate(f,r,nd,k,nnn,fi,lambda s,alpha level)
4. Power one pairs aggregate(f,r,nd,k,nnn,fi,lambda s,alpha level)

ExamplesEPV
To calculate the expected P-value at a variant with frequency f = 0.01 and GRR= 1.2 fora study with 1000 affected sib-pairs, for a disease with population prevalence k = 0.03 andsib recurrence risk ratio λs = 2 type: EPV pairs(0.01, 1.2, 0.03, 1000, 1/4, 2).
Similarly, for a study with 2000 affected individuals with an affected sibling, type:EPV one pairs(0.01, 1.2, 0.03, 2000, 1/4, 2)
For a locus with 3 disease variants and 3 random variants withf = (0.001, 0.005, 0.01, 0.001, 0.001, 0.007) and GRR= (2, 2, 2, 1, 1, 1) and for a study with
1000 affected sib-pairs, for a disease with population prevalence k = 0.03 and sib recurrence
risk ratio λs = 2 type:f = c(0.001, 0.005, 0.01, 0.001, 0.001, 0.007)
GRR= c(2, 2, 2, 1, 1, 1)
EPV pairs aggregate(f, GRR, 6, 0.03, 1000, 1/4, 2)Power
To calculate the power for α = 1.6 · 10−6 at a variant with frequency f = 0.01 and GRR= 1.2
for a study with 1000 affected sib-pairs, for a disease with population prevalence k = 0.03
and sib recurrence risk ratio λs = 2 type: Power pairs(0.01, 1.2, 0.03, 1000, 1/4, 2, 1.6 ∗ 10−6 ).
Similarly, for a study with 2000 affected individuals with an affected sibling, type:
Power one pairs(0.01, 1.2, 0.03, 2000, 1/4, 2, 1.6 ∗ 10−6 ).
For a locus with 3 disease variants and 3 random variants withf = (0.001, 0.005, 0.01, 0.001, 0.001, 0.007) and GRR= (2, 2, 2, 1, 1, 1) and for a study with1000 affected sib-pairs, for a disease with population prevalence k = 0.03 and sib recurrence
risk ratio λs = 2 type:2

f=c(0.001,0.005,0.01,0.001,0.001,0.007)
GRR=c(2,2,2,1,1,1)
Power pairs aggregate(f, GRR, 6, 0.03, 1000, 1/4, 2, 1.6 ∗ 10−6 )3