power.ACE.test | R Documentation |
power.ACE.test
simulates a univariate ACE model. It
computes power to detect dropping one or more paths (a, c, or a after dropping c), specified in drop=
.
The interface and functionality of this service are experimental and subject to change.
power.ACE.test(
AA = 0.5,
CC = 0,
EE = NULL,
DD = NULL,
update = c("a", "c", "a_after_dropping_c", "d"),
value = 0,
n = NULL,
MZ_DZ_ratio = 1,
sig.level = 0.05,
power = 0.8,
method = c("ncp", "empirical"),
search = FALSE,
tryHard = c("yes", "no", "ordinal", "search"),
digits = 2,
optimizer = NULL,
nSim = 4000
)
AA |
Additive genetic variance (Default .5) |
CC |
Shared environment variance (Default 0) |
EE |
Unique environment variance. Leave NULL (default) to compute an amount summing to 1. |
DD |
Dominance Is set (default= NULL) compute an ADE rather than ACE model (DZr=.25) |
update |
Component to drop (Default "a", i.e., drop a) |
value |
Value to set dropped path to (Default 0) |
n |
If provided, solve at the given number of MZ+DZ pairs (Default NULL) |
MZ_DZ_ratio |
MZ pairs per DZ pair (Default 1 = equal numbers.) |
sig.level |
alpha (p-value) Default = 0.05 |
power |
Default = .8 (80 percent power, equal to 1 - Type II rate) |
method |
How to estimate power: Default = use non-centrality parameter ("ncp"). Alternative is "empirical" |
search |
Whether to return a search across power or just a point estimate (Default FALSE = point) |
tryHard |
Whether to tryHard to find a solution (default = "yes", alternatives are "no"...) |
digits |
Rounding for reporting parameters (default 2) |
optimizer |
If set, will switch the optimizer. |
nSim |
Total number of pairs to simulate in the models (default = 4000) |
Statistical power is the proportion of studies that, over the long run, one should expect to yield a statistically
significant result given certain study characteristics such as sample size (N), the expected effect size (\beta
),
and the criterion for statistical significance (\alpha
).
(with nMZpairs= 2000 and MZ_DZ_ratio*nMZpairs DZ twins.
A typical target for power is 80%. Much as the accepted critical p-value is .05, this has emerged as a trade off, in this case of resources required for more powerful studies against the cost of missing a true effect. People interested in truth discourage running studies with low power: A study with 20 percent power will fail to detect real effects 80% of the time. But even with zero power, the Type-I error rate remains a nominal 5% (and with any researcher degrees of freedom, perhaps much more than that). Low powered research, then, fails to detect true effects, and generates support for random false theories about as often. This sounds silly, but empirical rates are often as low as 20% (Button, et al., 2013).
Illustration of \alpha
, \beta
, and power (1-\beta
):
OpenMx::mxPower()
object
Visscher, P.M., Gordon, S., Neale, M.C. (2008). Power of the classical twin design revisited: II detection of common environmental variance. Twin Res Hum Genet, 11: 48-54. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1375/twin.11.1.48")}.
Button, K. S., Ioannidis, J. P., Mokrysz, C., Nosek, B. A., Flint, J., Robinson, E. S., and Munafo, M. R. (2013). Power failure: why small sample size undermines the reliability of neuroscience. Nature Reviews Neuroscience, 14, 365-376. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1038/nrn3475")}
umxPower()
, OpenMx::mxPower()
, umxACE()
Other Twin Modeling Functions:
umx
,
umxACE()
,
umxACEcov()
,
umxACEv()
,
umxCP()
,
umxDiffMZ()
,
umxDiscTwin()
,
umxDoC()
,
umxDoCp()
,
umxGxE()
,
umxGxE_window()
,
umxGxEbiv()
,
umxIP()
,
umxMRDoC()
,
umxReduce()
,
umxReduceACE()
,
umxReduceGxE()
,
umxRotate.MxModelCP()
,
umxSexLim()
,
umxSimplex()
,
umxSummarizeTwinData()
,
umxSummaryACE()
,
umxSummaryACEv()
,
umxSummaryDoC()
,
umxSummaryGxEbiv()
,
umxSummarySexLim()
,
umxSummarySimplex()
,
umxTwinMaker()
# =====================================================
# = N for .8 power to detect a^2 = .5 equal MZ and DZ =
# =====================================================
power.ACE.test(AA = .5, CC = 0, update = "a")
# Suggests n = 84 MZ and 94 DZ pairs.
## Not run:
# ================================
# = Show power across range of N =
# ================================
power.ACE.test(AA= .5, CC= 0, update = "a", search = TRUE)
# Salutary note: You need well fitting models with correct betas in the data
# for power to be valid.
# tryHard helps ensure this, as does the default nSim= 4000 pair data.
# Power is important to get right, so I recommend using tryHard = "yes" (the default)
# =====================
# = Power to detect C =
# =====================
# 102 of each of MZ and DZ pairs for 80% power (default).
power.ACE.test(AA= .5, CC= .3, update = "c")
# ==========================================
# = Set 'a' to a fixed, but non-zero value =
# ==========================================
power.ACE.test(update= "a", value= sqrt(.2), AA= .5, CC= 0)
# ========================================
# = Drop More than one parameter (A & C) =
# ========================================
# E vs AE: the hypothesis that twins show no familial similarity.
power.ACE.test(update = "a_after_dropping_c", AA= .5, CC= .3)
# ===================================================
# = More power to detect A > 0 when more C present =
# ===================================================
power.ACE.test(update = "a", AA= .5, CC= .0)
power.ACE.test(update = "a", AA= .5, CC= .3)
# ====================================================
# = More power to detect C > 0 when more A present? =
# ====================================================
power.ACE.test(update = "c", AA= .0, CC= .5)
power.ACE.test(update = "c", AA= .3, CC= .5)
# ===================================
# = Power with more DZs or more MZs =
# ===================================
# Power about the same: total pairs with 2 MZs per DZ
power.ACE.test(MZ_DZ_ratio= 2/1, update= "a", AA= .3, CC= 0, method="ncp", tryHard="yes")
power.ACE.test(MZ_DZ_ratio= 1/2, update= "a", AA= .3, CC= 0, method="ncp", tryHard="yes")
power.ACE.test(update= "a", AA= .3, CC= 0, method="ncp", tryHard="yes")
# =====================================
# = Compare ncp and empirical methods =
# =====================================
power.ACE.test(update= "a", AA= .5, CC= 0, method = "ncp")
# method = "ncp": For 80% power, you need 166 MZ and 166 DZ pairs
power.ACE.test(update= "a", AA= .5, CC= 0, method= "empirical")
# method= "empirical": For 80% power, you need 154 MZ and 154 DZ pairs
# ====================
# = Show off options =
# ====================
# 1. tryHard
power.ACE.test(update = "a", AA= .5, CC= 0, tryHard= "no")
# 2. toggle optimizer
power.ACE.test(update= "a", AA= .5, CC= 0, optimizer= "SLSQP")
# 3. You can raise or lower the number of pairs used in the true model
# by varying nSim (twin pairs in the simulated data).
power.ACE.test(update = "a", AA= .5, CC= 0, nSim= 20)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.