Title: | Power Analyses for the Affected Sib Pair and the TDT Design |
---|---|
Description: | There are two main functions: (1) To estimate the power of testing for linkage using an affected sib pair design, as a function of the recurrence risk ratios. We will use analytical power formulae as implemented in R. These are based on a Mathematica notebook created by Martin Farrall. (2) To examine how the power of the transmission disequilibrium test (TDT) depends on the disease allele frequency, the marker allele frequency, the strength of the linkage disequilibrium, and the magnitude of the genetic effect. We will use an R program that implements the power formulae of Abel and Muller-Myhsok (1998). These formulae allow one to quickly compute power of the TDT approach under a variety of different conditions. This R program was modeled on Martin Farrall's Mathematica notebook. |
Authors: | Daniel E. Weeks |
Maintainer: | Daniel E. Weeks <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.6 |
Built: | 2024-11-01 11:15:26 UTC |
Source: | https://github.com/cran/powerpkg |
This is an interactive program designed to illustrate the basic principles of what controls power. Here, we assume that under the null, the statistic is distributed as a standard normal with mean zero and variance one, while under the alternative, the statistic is distributed as a standard normal with a shifted mean. Power is a function of the mean under the alternative hypothesis and the desired significance level. The 'Options' box allows the user to select the desired significance level using the radio buttons, and to set the mean under the alternative hypothesis using the slider.
normplot()
normplot()
This is a modified version of the 'tkdensity' demo from the 'tcltk' package.
A graph is drawn which reflects the user's choices. The resulting power is displayed in the title line of the graph, as well as the mean under the alternative hypothesis. The red line indicates the density under the null hypothesis (mean = 0), and the black line indicates the density under the alternative hypothesis. The vertical blue line indicates the significance threshold.
Daniel E. Weeks
The nsibs() function will compute the number of affected sibpairs needed to detect linkage to a susceptibility gene attributed with a user-specified lambda sib (ls) and lambda off (lo). Lambda sib is the recurrence risk ratio for full- sibs (includes dominance variance), lambda off is the recurrence risk ratio for parent- offspring pairs (so does not include dominance variance). In these calculations we assume that parents and sibs are completely genotyped with markers that perfectly define the IBD configurations. alpha and beta correspond to the type 1 and 1 - type 2 error rates respectively.
nsibs(ls, lo, alpha, beta)
nsibs(ls, lo, alpha, beta)
ls |
the recurrence risk ratio for full-sibs (includes dominance variance). |
lo |
the recurrence risk ratio for parent- offspring pairs (so does not include dominance variance) |
alpha |
the Type 1 error rate. |
beta |
one minus the Type 2 error rate, so (1-beta)=Power. |
In these calculations we assume that parents and sibs are completely genotyped with markers that perfectly define the IBD configurations.
n |
The number of sib pairs needed to obtain the desired power under the chosen study design. |
Makes the simplifying assumptions that (1) all families will have exactly two affected sibpairs; and that (2) the identity-by-descent status in the ASPs can be determined unambiguously
These are based on a Mathematica notebook created by Martin Farrall.
Daniel E. Weeks
## Use the nsibs() function to calculate the number of sibpairs required ## when lambda sib = 2 and lambda off = 2, in order to have 85 percent ## power to detect linkage at an alpha level of 0.05. nsibs(ls=2,lo=2,alpha=0.05,beta=0.15)
## Use the nsibs() function to calculate the number of sibpairs required ## when lambda sib = 2 and lambda off = 2, in order to have 85 percent ## power to detect linkage at an alpha level of 0.05. nsibs(ls=2,lo=2,alpha=0.05,beta=0.15)
Calculation of how many TDT trios need to be studied in order to have an adequately powered TDT study. The user specifies the susceptibility gene allele frequency (q), the frequency of the marker allele (m) in linkage disequilibrium with the susceptibility allele, the strength of the linkage disequilibrium between marker and susceptibility allele (ld), the genotype risk ratio for the susceptibility gene (g), the desired power (power) and the type 1 error rate (alpha) allowing for multiple testing.
ntdt(g, q, m, ld, power, alpha)
ntdt(g, q, m, ld, power, alpha)
g |
the genotype risk ratio for the susceptibility gene |
q |
the susceptibility allele frequency |
m |
the frequency of the marker allele in linkage disequilibrium with the susceptibility allele. |
ld |
the strength ofthe linkage disequilibrium between marker and susceptibility allele, on a scale of 0 to 1. |
power |
the desired power |
alpha |
the Type 1 error rate |
We will use an R program that implements the power formulae of Abel and Muller-Myhsok (1998). These formulae allow one to quickly compute power of the TDT approach under a variety of different conditions. This R program was modeled on Martin Farrall's Mathematica notebook.
The power computations here use a simple genetic model with several aspects: (1) The disease locus has two alleles, A and a, with allele frequencies q and 1-q. The risk of disease follows a multiplicative model with genotype relative risks of g and g*g for the A/a and A/A subjects. (2) There is a perfectly linked marker with two alleles, with allele frequencies m and 1-m.
nfam |
The number of trios needed to obtain the desired power. |
This R program was modeled on Martin Farrall's Mathematica notebook.
Daniel E. Weeks
Abel L, Muller-Myhsok B. Maximum-likelihood expression of the transmission/disequilibrium test and power considerations. Am J Hum Genet. 1998 Aug;63(2):664-7.
Chen WM, Deng HW. A general and accurate approach for computing the statistical power of the transmission disequilibrium test for complex disease genes. Genet Epidemiol. 2001 Jul;21(1):53-67.
Iles MM. On calculating the power of a TDT study–comparison of methods. Ann Hum Genet. 2002 Jul;66(Pt 4):323-8.
Purcell S, Cherny SS, Sham PC. Genetic Power Calculator: design of linkage and association genetic mapping studies of complex traits. Bioinformatics. 2003 Jan;19(1):149-50.
## Compute the number of TDT trios would be needed under these conditions: ## q = 0.15; m = 0.25;ld= 0.45;g= 1.5;power =0.85;alpha =0.05; ntdt(q=0.15,m=0.25,ld=0.45,g=1.5,power=0.85,alpha = 0.05)
## Compute the number of TDT trios would be needed under these conditions: ## q = 0.15; m = 0.25;ld= 0.45;g= 1.5;power =0.85;alpha =0.05; ntdt(q=0.15,m=0.25,ld=0.45,g=1.5,power=0.85,alpha = 0.05)
Power for a TDT study will be highest when the frequency of the susceptibility allele (q) matches the frequency of the associated allele (m). We can now examine this by using the ntdt.q() function, which returns a table give the required sample sizes (and log sample sizes) for a range of values of q, at three different levels of ld. These levels are (1) the maximum (dmax), (2) 75% of the maximum (dmax.75), and (3) 50% of the maximum (dmax.50).
ntdt.q(g, m, alpha = 5e-08, power = 0.8)
ntdt.q(g, m, alpha = 5e-08, power = 0.8)
g |
the genotype risk ratio for the susceptibility gene |
m |
the frequency of the marker allele in linkage disequilibrium with the susceptibility allele. |
alpha |
the Type 1 error rate |
power |
the desired power |
We will use an R program that implements the power formulae of Abel and Muller-Myhsok (1998). These formulae allow one to quickly compute power of the TDT approach under a variety of different conditions. This R program was modeled on Martin Farrall's Mathematica notebook.
The power computations here use a simple genetic model with several aspects: (1) The disease locus has two alleles, A and a, with allele frequencies q and 1-q. The risk of disease follows a multiplicative model with genotype relative risks of g and g*g for the A/a and A/A subjects. (2) There is a perfectly linked marker with two alleles, with allele frequencies m and 1-m.
This function returns a table give the required sample sizes (and log sample sizes) for a range of values of q, at three different levels of ld. These levels are (1) the maximum (dmax), (2) 75% of the maximum (dmax.75), and (3) 50% of the maximum (dmax.50).
The results can be plotted using the plotNtdt function.
This R program was modeled on Martin Farrall's Mathematica notebook.
Daniel E. Weeks
Abel L, Muller-Myhsok B. Maximum-likelihood expression of the transmission/disequilibrium test and power considerations. Am J Hum Genet. 1998 Aug;63(2):664-7.
Chen WM, Deng HW. A general and accurate approach for computing the statistical power of the transmission disequilibrium test for complex disease genes. Genet Epidemiol. 2001 Jul;21(1):53-67.
Iles MM. On calculating the power of a TDT study–comparison of methods. Ann Hum Genet. 2002 Jul;66(Pt 4):323-8.
Purcell S, Cherny SS, Sham PC. Genetic Power Calculator: design of linkage and association genetic mapping studies of complex traits. Bioinformatics. 2003 Jan;19(1):149-50.
ntdt.q(g=2,m=0.5,alpha=0.00000005,power=0.80)
ntdt.q(g=2,m=0.5,alpha=0.00000005,power=0.80)
plotDom plots the effects of dominance on sample size in an affected sibpair linkage study.
plotDom(lsib = 1.2, alpha = 0.001, power = 0.85,...)
plotDom(lsib = 1.2, alpha = 0.001, power = 0.85,...)
lsib |
is the relative risk ratio to a sibling. |
alpha |
Type 1 error rate (significane level) |
power |
is the power of the study to detect inkage under the (ideal) chosen conditions and parameters. |
... |
additional arguments for plot |
Creates a plot, and returns a table of the data that generated the plot. In this table, the first column gives the lambda off value, while the second column gives the corresponding number of affected sib pairs needed to have the desired power.
Makes the simplifying assumptions that (1) all families will have exactly two affected sibpairs; and that (2) the identity-by-descent status in the ASPs can be determined unambiguously
These are based on a Mathematica notebook created by Martin Farrall.
Daniel E. Weeks
## Plot the effects of dominance on sample size in an affected sibpair ## linkage study. Do this under the assumption that lambda sib is 1.2, ## and the desired power is 85 percent at an alpha level of 0.001. plotDom(lsib=1.2,alpha=0.001,power=0.85)
## Plot the effects of dominance on sample size in an affected sibpair ## linkage study. Do this under the assumption that lambda sib is 1.2, ## and the desired power is 85 percent at an alpha level of 0.001. plotDom(lsib=1.2,alpha=0.001,power=0.85)
Plots the required sample sizes needed to detect linkage in an affected sib pair linakge study as a function of lambda sib, under the assumption that lambda sib = lambda off.
plotNsibs(alpha = 0.001, power = 0.85,...)
plotNsibs(alpha = 0.001, power = 0.85,...)
alpha |
the Type 1 error rate (significance level). |
power |
the power to detect linkage. |
... |
additional arguments for plot |
Assumes that lambda sib = lambda off.
Creates a plot, and returns a table of the data that generated the plot. In this table, the first column gives the lambda sib value, while the second column gives the corresponding number of affected sib pairs needed to have the desired power.
Makes the simplifying assumptions that (1) all families will have exactly two affected sibpairs; and that (2) the identity-by-descent status in the ASPs can be determined unambiguously
These are based on a Mathematica notebook created by Martin Farrall.
Daniel E. Weeks
## Plot the required sample sizes in an affected sib pair linkage study as ## a function of lambda sib required to have 85 percent power at an alpha ## level of 0.001, under the assumption that lambda sib = lambda off. plotNsibs(alpha=0.001,power=0.85)
## Plot the required sample sizes in an affected sib pair linkage study as ## a function of lambda sib required to have 85 percent power at an alpha ## level of 0.001, under the assumption that lambda sib = lambda off. plotNsibs(alpha=0.001,power=0.85)
This function plots the results from ntdt.q
plotNtdt(g, m, alpha = 5e-08, power = 0.8,...)
plotNtdt(g, m, alpha = 5e-08, power = 0.8,...)
g |
the genotype risk ratio for the susceptibility gene |
m |
the frequency of the marker allele in linkage disequilibrium with the susceptibility allele. |
alpha |
the Type 1 error rate |
power |
the desired power |
... |
additional arguments for plot |
We will use an R program that implements the power formulae of Abel and Muller-Myhsok (1998). These formulae allow one to quickly compute power of the TDT approach under a variety of different conditions. This R program was modeled on Martin Farrall's Mathematica notebook.
The power computations here use a simple genetic model with several aspects: (1) The disease locus has two alleles, A and a, with allele frequencies q and 1-q. The risk of disease follows a multiplicative model with genotype relative risks of g and g*g for the A/a and A/A subjects. (2) There is a perfectly linked marker with two alleles, with allele frequencies m and 1-m.
A plot of the results generated by a call to the ntdt.q() function.
This R program was modeled on Martin Farrall's Mathematica notebook.
Daniel E. Weeks
Abel L, Muller-Myhsok B. Maximum-likelihood expression of the transmission/disequilibrium test and power considerations. Am J Hum Genet. 1998 Aug;63(2):664-7.
Chen WM, Deng HW. A general and accurate approach for computing the statistical power of the transmission disequilibrium test for complex disease genes. Genet Epidemiol. 2001 Jul;21(1):53-67.
Iles MM. On calculating the power of a TDT study–comparison of methods. Ann Hum Genet. 2002 Jul;66(Pt 4):323-8.
Purcell S, Cherny SS, Sham PC. Genetic Power Calculator: design of linkage and association genetic mapping studies of complex traits. Bioinformatics. 2003 Jan;19(1):149-50.
## Duplicate Figures 1 and 2 from Abel and Muller-Myhsok (1998) ## Am J Hum Genet 63:664-667 plotNtdt(g=2,m=0.10) ## gives Figure 1A plotNtdt(g=2,m=0.50) ## gives Figure 1B
## Duplicate Figures 1 and 2 from Abel and Muller-Myhsok (1998) ## Am J Hum Genet 63:664-667 plotNtdt(g=2,m=0.10) ## gives Figure 1A plotNtdt(g=2,m=0.50) ## gives Figure 1B
Create a power table for different values of q.
ptb(g, m, ld, nfam, alpha)
ptb(g, m, ld, nfam, alpha)
g |
the genotype risk ratio for the susceptibility gene. |
m |
the frequency of the marker allele in linkage disequilibrium with the susceptibility allele. |
ld |
the strength ofthe linkage disequilibrium between marker and susceptibility allele, on a scale of 0 to 1. |
nfam |
the number of families. |
alpha |
the significance level of the test. |
We will use an R program that implements the power formulae of Abel and Muller-Myhsok (1998). These formulae allow one to quickly compute power of the TDT approach under a variety of different conditions. This R program was modeled on Martin Farrall's Mathematica notebook.
The power computations here use a simple genetic model with several aspects: (1) The disease locus has two alleles, A and a, with allele frequencies q and 1-q. The risk of disease follows a multiplicative model with genotype relative risks of g and g*g for the A/a and A/A subjects. (2) There is a perfectly linked marker with two alleles, with allele frequencies m and 1-m.
tb |
A table of power results as a function of q |
This R program was modeled on Martin Farrall's Mathematica notebook.
Daniel E. Weeks
Abel L, Muller-Myhsok B. Maximum-likelihood expression of the transmission/disequilibrium test and power considerations. Am J Hum Genet. 1998 Aug;63(2):664-7.
Chen WM, Deng HW. A general and accurate approach for computing the statistical power of the transmission disequilibrium test for complex disease genes. Genet Epidemiol. 2001 Jul;21(1):53-67.
Iles MM. On calculating the power of a TDT study–comparison of methods. Ann Hum Genet. 2002 Jul;66(Pt 4):323-8.
Purcell S, Cherny SS, Sham PC. Genetic Power Calculator: design of linkage and association genetic mapping studies of complex traits. Bioinformatics. 2003 Jan;19(1):149-50.
ptb(g=1.5,m=0.5,ld=0.75,nfam=2000,alpha=0.00000005)
ptb(g=1.5,m=0.5,ld=0.75,nfam=2000,alpha=0.00000005)
Function to compute power for a TDT design using formulae from Abel and Muller-Myhsok (1998) Am J Hum Genet 63:664-667
ptdt(g, q, m, ld, nfam, alpha)
ptdt(g, q, m, ld, nfam, alpha)
g |
the genotype risk ratio for the susceptibility gene. |
q |
the susceptibility allele frequency |
m |
the frequency of the marker allele in linkage disequilibrium with the susceptibility allele. |
ld |
the strength ofthe linkage disequilibrium between marker and susceptibility allele, on a scale of 0 to 1. |
nfam |
the number of families. |
alpha |
the significance level of the test. |
We will use an R program that implements the power formulae of Abel and Muller-Myhsok (1998). These formulae allow one to quickly compute power of the TDT approach under a variety of different conditions. This R program was modeled on Martin Farrall's Mathematica notebook.
The power computations here use a simple genetic model with several aspects: (1) The disease locus has two alleles, A and a, with allele frequencies q and 1-q. The risk of disease follows a multiplicative model with genotype relative risks of g and g*g for the A/a and A/A subjects. (2) There is a perfectly linked marker with two alleles, with allele frequencies m and 1-m.
power |
power of the statistical test under the chosen conditions. |
This R program was modeled on Martin Farrall's Mathematica notebook.
Daniel E. Weeks
Abel L, Muller-Myhsok B. Maximum-likelihood expression of the transmission/disequilibrium test and power considerations. Am J Hum Genet. 1998 Aug;63(2):664-7.
Chen WM, Deng HW. A general and accurate approach for computing the statistical power of the transmission disequilibrium test for complex disease genes. Genet Epidemiol. 2001 Jul;21(1):53-67.
Iles MM. On calculating the power of a TDT study–comparison of methods. Ann Hum Genet. 2002 Jul;66(Pt 4):323-8.
Purcell S, Cherny SS, Sham PC. Genetic Power Calculator: design of linkage and association genetic mapping studies of complex traits. Bioinformatics. 2003 Jan;19(1):149-50.
ptdt(q=0.15,m=0.25,ld=0.45,g=2.5,alpha = 0.05,nfam=300) ptdt(q=0.15,m=0.25,ld=0.45,g=2.5,alpha = 0.05,nfam=400)
ptdt(q=0.15,m=0.25,ld=0.45,g=2.5,alpha = 0.05,nfam=300) ptdt(q=0.15,m=0.25,ld=0.45,g=2.5,alpha = 0.05,nfam=400)