View source: R/hapPowerAsymp.R
hapPowerAsymp | R Documentation |
Computes the asymptotic power for genetic analyses assessing fetal effects, maternal effects and/or parent-of-origin effects. Effects of X-chromosome genes and gene-environment interaction effects are also allowed.
hapPowerAsymp(nall = 2, n.strata = 1, cases, controls, haplo.freq,
RR, RRcm, RRcf, RRstar, RR.mat, RRstar.mat,
xchrom = F, sim.comb.sex = "double", BR.girls,
response = "mult", alpha = 0.05, ...)
nall |
A vector of the number of alleles at each locus. By default a diallellic SNP. |
n.strata |
The number of strata. |
cases |
A list of the number of case families. Each element is a vector of the number of families of the specified family design in the corresponding stratum. The possible family designs, i.e., the possible names of the elements, are |
controls |
A list of the number of control families. Each element is a vector of the number of families of the specified family design in the corresponding stratum. The possible family designs are |
haplo.freq |
A list of which each element is a numeric vector of the haplotype frequencies in each stratum. The frequencies are normalized and sum to one. The Details section shows how to implement this argument in agreement with the possible haplotypes. |
RR |
A list of which each element is a numeric vector of the relative risks in each stratum. The Details section shows how to implement this argument in agreement with the possible haplotypes. |
RRcm |
A list of numeric vectors. Each vector contains the relative risks associated with the haplotypes transmitted from the mother for this stratum. See Details for description of how to implement this argument in agreement with the possible haplotypes. |
RRcf |
A list of numeric vectors. Each vector contains the relative risks associated with the haplotypes transmitted from the father for this stratum. See Details for description of how to implement this argument in agreement with the possible haplotypes. |
RRstar |
A list of numeric vectors. Estimates how much double-dose children would deviate from the risk expected in a multiplicative dose-response relationship. |
RR.mat |
The interpretation is similar to |
RRstar.mat |
The interpretation is similar to |
xchrom |
Logical. Equals |
sim.comb.sex |
To be used with |
BR.girls |
To be used with |
response |
The default value "mult" specifies a multiplicative dose-response model. |
alpha |
|
... |
Could include argument |
The Haplin framework includes different modules for assessing genetic effects: haplin
,
haplinStrat
and haplinSlide
. hapPowerAsymp
computes the asymptotic power for these analyses, which enables power calculations of fetal effects, maternal effects and/or parent-of-origin effects. Various family designs, i.e., triads, case-control, the hybrid design, and all intermediate designs, are possible.
It also allows power calculation of gene-environment interaction effects and effects on X-chromosome markers.
hapPower
computes power through "brute force" simulations using hapRun
. This is a robust way of checking software implementations, asymptotic approximations
and attained significance level. However, both power and the corresponding sample size calculations can be performed much more efficiently using asymptotic approximations.
The asymptotic power is calculated applying the non-centrality parameter of the Wald tests, which use the asymptotic normal distribution of the log-scale parameter. The function hapCovar
(used by hapPowerAsymp
) computes the variance-covariance matrix
by applying the log-linear model combined with the EM algorithm.
Specifying haplotype risks:
The number of haplotypes used in the simulations is determined by the nall
argument, since prod(nall)
different haplotypes can be made from the specified number of markers, length(nall)
. The arguments haplo.freq
, RR
, RRcm
, RRcf
, RRstar
, RR.mat
, and RRstar.mat
are all lists where each element represents a stratum. Within each stratum, the arguments are vectors of length equal to the number of haplotypes, specifying the relative risk etc. associated with each haplotype.
The stratum specific arguments may be simplified if the number of strata is one, or if the arguments are equal across all strata.
The haplotypes are determined by creating all possible haplotypes from the given markers, in a sequence where the first marker varies mostly quickly. For instance, if nall = c(3,2)
, the first marker has 3 alleles, the second has 2, and 6 haplotypes are possible. Taken in order, the haplotypes are 1-1, 2-1, 3-1, 1-2, 2-2, and 3-2. When specifying, say, RR = c(1,2,1,1,1,1)
the haplotype 2-1 has a double risk compared to the rest. With, for instance, two strata, the specification RR = list(c(1,2,1,1,1,1), c(1,1,1,1,1,1))
would mean that the risk associated with 2-1 is elevated only in the first stratum, not the second.
The simplest example would be with nall = c(2)
and RR = c(1,2)
, which would simulate a single SNP where the second allele has a double risk.
Specifying genetic effects:
Standard fetal effects are specified by the arguments RR
and RRstar
, whereas parent-of-origin effects are addressed by the arguments RRcm
, RRcf
and RRstar
. Maternal effects are included by the additional arguments RRmat
and RRstar.mat
.
hapPowerAsymp
returns the asymptotic power for the relevant genetic effects. The first element of the list depicts the power for each haplotype analyzed separately.
If there are more than two possible haplotypes, the second element displays the overall power for all haplotypes combined.
Miriam Gjerdevik,
with Hakon K. Gjessing
Professor of Biostatistics
Division of Epidemiology
Norwegian Institute of Public Health
Web Site: https://haplin.bitbucket.io
haplin
, haplinSlide
, haplinStrat
, hapSim
, hapRun
, snpPower
, hapPower
## Calculate the asymptotic power for a triad design
## when the minor allele increases the fetal risk by twofold.
## Assumes a multiplicative dose-response relationship.
hapPowerAsymp(nall = c(2), n.strata = 1, cases = list(c(mfc=120)),
haplo.freq = c(0.1,0.9), RR = c(2,1), RRstar = c(1,1))
## Calculate the asymptotic power for the hybrid design when
## the minor allele increases the fetal risk by twofold
## in the first stratum and no effect is seen in the second
## i.e., gene-environment interaction (GxE) effects.
hapPowerAsymp(nall = c(2), n.strata = 2, cases = list(c(mfc=100)),
controls = list(c(mfc=100)), haplo.freq = c(0.1,0.9),
RR = list(c(2,1), c(1,1)), RRstar = c(1,1))
## Calculate the asymptotic GxE power assessing maternal- and
## parent-of-origin effects at two diallelic loci.
hapPowerAsymp(nall = c(2,2), n.strata = 2, cases = c(mfc=500),
haplo.freq = c(0.1,0.2,0.3,0.4),
RRcm = list(c(3,1,1,1), c(1,1,1,1)), RRcf = c(1,1,1,1), RRstar = c(1,1,1,1),
RR.mat = list(c(1.5,1,1,1),c(1,1,1,1)), RRstar.mat = c(1,1,1,1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.