Learn R Programming

RRate (version 1.0)

repSampleSizeRR: Sample size determination for the replication study based on RR

Description

repSampleSizeRR and repSampleSizeRR2 implement the RR-based sample size determination method for the replication study. If the replication study has the same control-to-case ratio with the primary study, then repSampleSizeRR can be used. Otherwise, repSampleSize2 is more suitable.

Usage

repSampleSizeRR(GRR, n, MUhat, SE, zalpha2, zalphaR2, idx = TRUE)
repSampleSizeRR2(GRR,CCR2, MUhat,SE,fU,fA,zalpha2,zalphaR2, idx=TRUE)

Arguments

GRR

The desired global replication rate.

n
Sample size in the primary study.
MUhat
The observed effect size (log-odds ratio).
SE
The standard error of MUhat.
zalpha2
The critical value of z-values in the primary study, i.e. z_alpha/2.
zalphaR2
The critical value of z-values in the replication study, i.e. z_alphaR/2.
idx
The indexes of the SNPs having been further inverstigated in the replication study. We only calculate RR for primary associations with indexes in idx.
CCR2
The control-to-case ratio of the replication study.
fU
The allele frequency in the control group.
fA
The allele frequency in the case group.

Value

The determined sample size of the replication study is returned.

References

Jiang, W., Xue, J-H, and Yu, W. What is the probability of replicating a statistically significant association in genome-wide association studies?. Submitted.

See Also

RRate repRateEst, SEest, HLtest

Examples

Run this code
alpha<-5e-6               #Significance level in the primary study
alphaR<-5e-3              #Significance level in the replication study
zalpha2<-qnorm(1-alpha/2)
zalphaR2<-qnorm(1-alphaR/2)

##Load data
data('smryStats1')        #Example of summary statistics in 1st study
#### Sample size determination ###
n1<-4000                  #Sample size of the primary study
n2_1<-repSampleSizeRR(0.8, n1, log(smryStats1$OR),smryStats1$SE,zalpha2,zalphaR2)

CCR2<-2                   #Control-to-case ration in the replication study
n2_2<-repSampleSizeRR2(0.8, CCR2, log(smryStats1$OR),smryStats1$SE,smryStats1$F_U, 
smryStats1$F_A,zalpha2,zalphaR2)

Run the code above in your browser using DataLab