Learn R Programming

umx (version 4.9.0)

power.ACE.test: Test the power of an ACE model to detect paths of interest.

Description

power.ACE.test simulates a univariate ACE model (with nMZpairs= 2000 and MZ_DZ_ratio*nMZpairs DZ twins. It computes power to detect dropping one or more paths specified in drop=. The interface and functionality of this service are experimental and subject to change.

Usage

power.ACE.test(
  AA = 0.5,
  CC = 0,
  EE = NULL,
  update = c("a", "c", "a_after_dropping_c"),
  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
)

Arguments

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

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 n (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)

Value

OpenMx::mxPower() object

Details

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

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\)):

Figure: power.png

References

  • 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. 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. 10.1038/nrn3475

See Also

Other Twin Modeling Functions: umxACEcov(), umxACEv(), umxACE(), umxCP(), umxDoCp(), umxDoC(), umxGxE_window(), umxGxEbiv(), umxGxE(), umxIP(), umxReduceACE(), umxReduceGxE(), umxReduce(), umxRotate.MxModelCP(), umxSexLim(), umxSimplex(), umxSummarizeTwinData(), umxSummaryACEv(), umxSummaryACE(), umxSummaryDoC(), umxSummaryGxEbiv(), umxSummarySexLim(), umxSummarySimplex(), umxTwinMaker(), umx

Examples

Run this code
# NOT RUN {
# =====================================================
# = 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.ACE.test(AA= .5, CC= 0, update = "a")

# =====================
# = Power to detect C =
# =====================

# 102 of each of MZ and DZ pairs for 80% power.
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 than MZs and vice versa =
# ===============================================

# Power about the same: total pairs with 2 MZs per DZ = 692, vs. 707
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")


# =====================================
# = Compare ncp and empirical methods =
# =====================================
# Compare to empirical mode: suggests 83.6 MZ and 83.6 DZ pairs

power.ACE.test(update= "a", AA= .5, CC= 0, method= "empirical")
# method= "empirical": For 80% power, you need 76 MZ and 76 DZ pairs
power.ACE.test(update= "a", AA= .5, CC= 0, method = "ncp")
# method = "ncp": For 80% power, you need 83.5 MZ and 83.5 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. How many twin pairs in the base simulated data?
power.ACE.test(update = "a", AA= .5, CC= 0)
power.ACE.test(update = "a", AA= .5, CC= 0, nSim= 20)

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab