Computes power for fixed case-control sample sizes using conditional genotype frequencies. The function supports model-based genotype frequencies, model-free genotype frequencies, optional locus heterogeneity, optional phenotype misclassification, optional genotype misclassification, genotype chi-square tests and genotype trend tests.
cc_power(
N_case,
alpha,
input_mode = c("model_based", "model_free"),
prev = NULL,
pd = NULL,
R2 = NULL,
MOI = c("M", "D", "Rec"),
g1 = NULL,
g0 = NULL,
locus_het = FALSE,
pi = 1,
pheno_misclass = FALSE,
theta = 0,
phi = 0,
k = 1,
w = c(0, 1, 2),
geno_misclass = c("none", "1p", "2p", "3p", "diff3p"),
e = 0,
e1 = 0,
e2 = 0,
e01 = 0,
e02 = 0,
e03 = 0,
case_e01 = 0,
case_e02 = 0,
case_e03 = 0,
ctrl_e01 = 0,
ctrl_e02 = 0,
ctrl_e03 = 0,
diff_source = c("explicit", "case", "ctrl"),
diff_multiplier = 1,
verbose = TRUE
)Numeric \(> 0\). Number of cases.
Numeric in \((0,1)\). Significance level.
Character. One of "model_based" or
"model_free". See Details.
Numeric in \((0,1)\). Disease prevalence for
input_mode = "model_based".
Numeric in \((0,1)\). Disease-allele frequency for
input_mode = "model_based".
Numeric \(> 0\). Homozygote relative risk for
input_mode = "model_based".
Character. Mode of inheritance for model-based frequencies:
"M" for multiplicative, "D" for dominant, or "Rec"
for recessive.
Numeric vectors of length 3 for input_mode = "model_free".
g1 gives case genotype frequencies and g0 gives control
genotype frequencies, each ordered as c(g0, g1, g2) and summing to 1.
Logical. If TRUE, requests a separate locus-
heterogeneity sensitivity scenario starting from the baseline frequencies.
Numeric in \([0,1]\). Locus-homogeneity fraction used when
locus_het = TRUE. When locus_het = FALSE, pi must
remain at its default value of 1.
Logical. If TRUE, requests a separate
phenotype-misclassification sensitivity scenario starting from baseline.
Numeric in \([0,1)\). Probability that a truly affected individual is classified as a control.
Numeric in \([0,1)\). Probability that a truly unaffected individual is classified as a case.
Numeric \(> 0\). Control-to-case sample size ratio \(N_{ctrl} / N_{case}\).
Numeric vector of length 3. Genotype trend-test scores. The three weights cannot all be equal.
Character. Genotype misclassification model:
"none", "1p", "2p", "3p", or "diff3p".
Numeric in \([0,0.5]\). For geno_misclass = "1p", the
probability assigned to each adjacent off-diagonal genotype call. The
textbook Eq. 2.5 parameter satisfies \(\epsilon=2e\); see Details.
Numeric. Two-parameter misclassification rates for
geno_misclass = "2p".
Numeric. Non-differential three-parameter
misclassification rates for geno_misclass = "3p".
Numeric. Case-specific three-parameter
misclassification rates for geno_misclass = "diff3p".
Numeric. Control-specific three-parameter
misclassification rates for geno_misclass = "diff3p".
Character. For geno_misclass = "diff3p", one of
"explicit", "case", or "ctrl". See Details.
Numeric \(\ge 0\). Multiplier used when
diff_source = "case" or diff_source = "ctrl".
Logical. If TRUE, prints a clean formatted summary.
An object of class "cc_power", containing:
Significance level and numbers of case, control, and total individuals.
Input mode, control-to-case ratio, trend scores, and locus-heterogeneity settings.
Genotype-error model and matrices, plus phenotype-error settings and intermediate frequencies.
Model-based penetrances and risk-model inputs, or model-free identifying information.
Named independent results. no_error always exists;
requested modifiers add phenotype_misclassification,
heterogeneity, and genotype_misclassification. Each contains
scenario frequencies, modifier metadata, and genotype/trend power results.
Compatibility fields. With zero
or one modifier, they mirror the sole design previously returned. With
several modifiers, they explicitly mirror no_error; use
scenarios for each sensitivity result.
The no-error scenario is always calculated from the baseline conditional case and control genotype frequencies. Each requested modifier is evaluated independently from that same baseline:
no error: baseline -> tests;
phenotype misclassification: baseline -> phenotype misclassification -> tests;
locus heterogeneity: baseline -> locus heterogeneity -> tests;
genotype misclassification: baseline -> genotype misclassification -> tests.
Supplying several modifiers requests several independent sensitivity
scenarios. Ordinary cc_power() does not combine modifiers. Specialized
joint-error methods such as LRTae and LTTae are separate methods and are not
implemented here.
With input_mode = "model_based", conditional case and control genotype
frequencies are derived from prev, pd, R2, and
MOI using Chapter 1, Section 1.4.2, Eqs. 1.6–1.7 (p. 13) of
Gordon, Finch, and Kim (2020). With input_mode = "model_free", the user supplies
g1 and g0 directly; when phenotype misclassification is
enabled, g1 is treated as the true affected genotype distribution and
g0 is treated as the true unaffected genotype distribution.
Phenotype misclassification requires prev in both input modes because
disease prevalence is used to mix the baseline affected and unaffected
genotype distributions into observed case and control distributions. Locus
heterogeneity uses
\(g_{case,het} = \pi g_{case,base} + (1 - \pi) g_{ctrl,base}\) and leaves
controls unchanged. Genotype misclassification matrices are likewise applied
directly to baseline case and control frequencies.
The genotype misclassification models are:
"none" for identity matrices, "1p" for one symmetric error
rate, "2p" for adjacent homozygote/heterozygote and heterozygote
error rates, "3p" for a non-differential three-parameter matrix, and
"diff3p" for separate case and control three-parameter matrices.
These matrices correspond to Eqs. 2.5–2.7 (pp. 57–58). For "1p",
package e is the probability in each adjacent off-diagonal cell and
the diagonal is \(1-2e\); textbook Eq. 2.5 uses off-diagonal
\(\epsilon/2\), so \(\epsilon=2e\). The genotype and trend tests use
Eqs. 1.22 and 1.24 (pp. 26–27), with the trend statistic defined by
Eqs. 1.20–1.21 (p. 24). Locus heterogeneity follows Eq. 2.16 (p. 88), where
pi is the homogeneous fraction; its trend-test form is given in
Eqs. 5.29a–b (pp. 287–288).
For geno_misclass = "diff3p", diff_source = "explicit" uses
the case and control error parameters exactly as supplied. With
diff_source = "case", control parameters are computed by multiplying
the case parameters by diff_multiplier. With
diff_source = "ctrl", case parameters are computed by multiplying the
control parameters by diff_multiplier.
With geno_misclass = "diff3p", returned power is nominal asymptotic
power evaluated with the usual chi-square critical value. Different case
and control error mechanisms can distort the null distribution and inflate
type I error. This function does not independently recalibrate the null
distribution for arbitrary differential genotyping error.
Internal effect-size components S are retained in the returned object
for validation and debugging, but are not printed in the clean verbose
output.
Gordon, D., Finch, S. J., & Kim, W. (2020). Heterogeneity in Statistical Genetics: How to Assess, Address, and Account for Mixtures in Association Studies. Springer. doi:10.1007/978-3-030-61121-7 .
Gordon, D., Finch, S. J., Nothnagel, M., & Ott, J. (2002). Power and sample size calculations for case-control genetic association tests when errors are present: application to single nucleotide polymorphisms. Human Heredity, 54(1), 22–33. doi:10.1159/000066696 .
Armitage, P. (1955). Tests for linear trends in proportions and frequencies. Biometrics, 11(3), 375–386. doi:10.2307/3001775 .
Slager, S. L., & Schaid, D. J. (2001). Case-control studies of genetic markers: power and sample size approximations for Armitage's test for trend. Human Heredity, 52(3), 149–153. doi:10.1159/000053370 .
Edwards, B. J., Haynes, C., Levenstien, M. A., Finch, S. J., & Gordon, D. (2005). Power and sample size calculations in the presence of phenotype errors for case/control genetic association studies. BMC Genetics, 6, 18. doi:10.1186/1471-2156-6-18 .
cc_power(
N_case = 500, alpha = 0.05,
input_mode = "model_free",
g1 = c(0.25, 0.50, 0.25),
g0 = c(0.36, 0.48, 0.16),
geno_misclass = "none",
verbose = FALSE
)
cc_power(
N_case = 500, alpha = 0.05,
input_mode = "model_free",
g1 = c(0.25, 0.50, 0.25),
g0 = c(0.36, 0.48, 0.16),
locus_het = TRUE, pi = 0.8,
verbose = FALSE
)
cc_power(
N_case = 500, alpha = 0.05,
input_mode = "model_free",
g1 = c(0.25, 0.50, 0.25),
g0 = c(0.36, 0.48, 0.16),
locus_het = TRUE, pi = 0.8,
geno_misclass = "3p", e01 = 0.02, e02 = 0.01, e03 = 0.005,
verbose = FALSE
)
cc_power(
N_case = 500, alpha = 0.05,
input_mode = "model_based",
prev = 0.05, pd = 0.30, R2 = 1.8, MOI = "M",
pheno_misclass = TRUE, theta = 0.05, phi = 0.01,
verbose = FALSE
)
cc_power(
N_case = 500, alpha = 0.05,
input_mode = "model_based",
prev = 0.05, pd = 0.30, R2 = 1.8, MOI = "M",
locus_het = TRUE, pi = 0.8,
geno_misclass = "3p", e01 = 0.02, e02 = 0.01, e03 = 0.005,
verbose = FALSE
)
cc_power(
N_case = 500, alpha = 0.05,
input_mode = "model_free",
g1 = c(0.25, 0.50, 0.25),
g0 = c(0.36, 0.48, 0.16),
geno_misclass = "diff3p",
diff_source = "explicit",
case_e01 = 0.02, case_e02 = 0.01, case_e03 = 0.005,
ctrl_e01 = 0.01, ctrl_e02 = 0.005, ctrl_e03 = 0.002,
verbose = FALSE
)
cc_power(
N_case = 500, alpha = 0.05,
input_mode = "model_free",
g1 = c(0.25, 0.50, 0.25),
g0 = c(0.36, 0.48, 0.16),
geno_misclass = "diff3p",
diff_source = "case", diff_multiplier = 0.5,
case_e01 = 0.02, case_e02 = 0.01, case_e03 = 0.005,
verbose = FALSE
)