Package 'powerpkg'

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

Help Index


Power plotting demonstration

Description

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.

Usage

normplot()

Details

This is a modified version of the 'tkdensity' demo from the 'tcltk' package.

Value

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.

Author(s)

Daniel E. Weeks


A function to compute power of an affected sib pair design.

Description

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.

Usage

nsibs(ls, lo, alpha, beta)

Arguments

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.

Details

In these calculations we assume that parents and sibs are completely genotyped with markers that perfectly define the IBD configurations.

Value

n

The number of sib pairs needed to obtain the desired power under the chosen study design.

Warning

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

Note

These are based on a Mathematica notebook created by Martin Farrall.

Author(s)

Daniel E. Weeks

See Also

plotNsibs, plotDom

Examples

## 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)

Computes number of trios needed for a TDT study.

Description

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.

Usage

ntdt(g, q, m, ld, power, alpha)

Arguments

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

Details

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.

Value

nfam

The number of trios needed to obtain the desired power.

Note

This R program was modeled on Martin Farrall's Mathematica notebook.

Author(s)

Daniel E. Weeks

References

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.

See Also

plotNtdt, ntdt.q

Examples

## 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)

Computes power of a TDT study as a function of the susceptibility allele frequency q.

Description

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).

Usage

ntdt.q(g, m, alpha = 5e-08, power = 0.8)

Arguments

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

Details

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.

Value

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.

Note

This R program was modeled on Martin Farrall's Mathematica notebook.

Author(s)

Daniel E. Weeks

References

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.

See Also

plotNtdt, ntdt

Examples

ntdt.q(g=2,m=0.5,alpha=0.00000005,power=0.80)

plotDom creates power graphs for an affected sibpair linkage study.

Description

plotDom plots the effects of dominance on sample size in an affected sibpair linkage study.

Usage

plotDom(lsib = 1.2, alpha = 0.001, power = 0.85,...)

Arguments

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

Value

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.

Warning

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

Note

These are based on a Mathematica notebook created by Martin Farrall.

Author(s)

Daniel E. Weeks

See Also

nsibs, plotNsibs

Examples

## 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)

plotNsibs: Create power plots for an affected sib pair linkage study

Description

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.

Usage

plotNsibs(alpha = 0.001, power = 0.85,...)

Arguments

alpha

the Type 1 error rate (significance level).

power

the power to detect linkage.

...

additional arguments for plot

Details

Assumes that lambda sib = lambda off.

Value

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.

Warning

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

Note

These are based on a Mathematica notebook created by Martin Farrall.

Author(s)

Daniel E. Weeks

See Also

nsibs, plotDom

Examples

## 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)

A function for plotting the results from ntdt.q

Description

This function plots the results from ntdt.q

Usage

plotNtdt(g, m, alpha = 5e-08, power = 0.8,...)

Arguments

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

Details

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.

Value

A plot of the results generated by a call to the ntdt.q() function.

Note

This R program was modeled on Martin Farrall's Mathematica notebook.

Author(s)

Daniel E. Weeks

References

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.

See Also

ntdt, ntdt.q

Examples

## 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

A power table for the TDT design

Description

Create a power table for different values of q.

Usage

ptb(g, m, ld, nfam, alpha)

Arguments

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.

Details

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.

Value

tb

A table of power results as a function of q

Note

This R program was modeled on Martin Farrall's Mathematica notebook.

Author(s)

Daniel E. Weeks

References

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.

See Also

plotNtdt, ntdt.q, ntdt, ptdt

Examples

ptb(g=1.5,m=0.5,ld=0.75,nfam=2000,alpha=0.00000005)

Power for a TDT design

Description

Function to compute power for a TDT design using formulae from Abel and Muller-Myhsok (1998) Am J Hum Genet 63:664-667

Usage

ptdt(g, q, m, ld, nfam, alpha)

Arguments

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.

Details

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.

Value

power

power of the statistical test under the chosen conditions.

Note

This R program was modeled on Martin Farrall's Mathematica notebook.

Author(s)

Daniel E. Weeks

References

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.

See Also

plotNtdt, ntdt.q, ntdt

Examples

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)