Package: genpwr 1.0.4

Camille Moore
genpwr: Power Calculations Under Genetic Model Misspecification
Power and sample size calculations for genetic association studies allowing for misspecification of the model of genetic susceptibility. "Hum Hered. 2019;84(6):256-271.<doi:10.1159/000508558>. Epub 2020 Jul 28." Power and/or sample size can be calculated for logistic (case/control study design) and linear (continuous phenotype) regression models, using additive, dominant, recessive or degree of freedom coding of the genetic covariate while assuming a true dominant, recessive or additive genetic effect. In addition, power and sample size calculations can be performed for gene by environment interactions. These methods are extensions of Gauderman (2002) <doi:10.1093/aje/155.5.478> and Gauderman (2002) <doi:10.1002/sim.973> and are described in: Moore CM, Jacobson S, Fingerlin TE. Power and Sample Size Calculations for Genetic Association Studies in the Presence of Genetic Model Misspecification. American Society of Human Genetics. October 2018, San Diego.
Authors:
genpwr_1.0.4.tar.gz
genpwr_1.0.4.tar.gz(r-4.5-noble)genpwr_1.0.4.tar.gz(r-4.4-noble)
genpwr_1.0.4.tgz(r-4.4-emscripten)genpwr_1.0.4.tgz(r-4.3-emscripten)
genpwr.pdf |genpwr.html✨
genpwr/json (API)
# Install 'genpwr' in R: |
install.packages('genpwr', repos = 'https://cloud.r-project.org') |
This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.
Last updated 4 years agofrom:51c256c4ce. Checks:3 OK. Indexed: yes.
Target | Result | Latest binary |
---|---|---|
Doc / Vignettes | OK | Mar 16 2025 |
R-4.5-linux | OK | Mar 16 2025 |
R-4.4-linux | OK | Mar 16 2025 |
Exports:add.fun.tadd.or.functionadditive.lladditive.ll.linearas.numeric2calc.likecalc.like.linearcalc.like.linear.log.envir.interactiondf2.lldf2.ll.lineardom.fun.tdom.or.functiondominant.lldominant.ll.lineares.calc.linearexpected.linear.llexpected.linear.ll.lin.envfind.prob.domfind.prob.recgenpwr.calcintegrand_funct_caseintegrand_funct_controllinear.mleslinear.mles.lin.envir.interactionlinear.mles.lin.envir.interaction_reducedlinear.mles.log.envir.interactionlinear.outcome.lin.envir.interaction.sdslinear.outcome.lin.envir.interaction.sds_reducedlinear.outcome.log.envir.interaction.sdslinear.sdsll_zero_finder2ll.ge.logisticll.ge.logistic.lin.envirll.linear.selectorlogistic.mleslogitncp.searchnull.llnull.ll.linearodds_ratio_functionor_calcor.function.2dfor.plotp_vec_returnerp_vec_returner_lin_envpower_envir.calcpower_envir.calc.linear_outcomepower_linear_envir.calc.linear_outcomepower_linear_envir.calc.logistic_outcomepower.calcpower.calc.linearpower.plotquad_rootsrec.fun.trec.or.functionrecessive.llrecessive.ll.linearsolve_ass_envir.calcss_envir.calc.linear_outcomess_linear_envir.calc.linear_outcomess_linear_envir.calc.logistic_outcomess.calcss.calc.linearss.plotX_mat_returnerX_mat_returner_llezero_finder_nleqslv
Dependencies:clicolorspacefansifarverggplot2gluegtableisobandlabelinglatticelifecyclemagrittrMASSMatrixmgcvmunsellnleqslvnlmepillarpkgconfigR6RColorBrewerrlangscalestibbleutf8vctrsviridisLitewithr
Citation
To cite package ‘genpwr’ in publications use:
Moore C, Jacobson S (2021). genpwr: Power Calculations Under Genetic Model Misspecification. R package version 1.0.4, https://CRAN.R-project.org/package=genpwr.
Corresponding BibTeX entry:
@Manual{, title = {genpwr: Power Calculations Under Genetic Model Misspecification}, author = {Camille Moore and Sean Jacobson}, year = {2021}, note = {R package version 1.0.4}, url = {https://CRAN.R-project.org/package=genpwr}, }
Readme and manuals
genpwr
The genpwr package for R (>3.5.1) performs power and sample size calculations for genetic association studies and allows for mis-specification of the genetic model. Calculations can be performed for binary (case/control) and continuous outcomes. Power and sample size calculations are possible for genetic effects as well as gene by environment interactions.
Example
To calculate power to detect an odds ratio of 2 for a 1:1 case control study with 2,000 subjects, assuming an alpha of 0.05, at minor allele frequencies of 0.1, 0.2, and 0.3:
library(genpwr)
#> Loading required package: ggplot2
#> Loading required package: nleqslv
#> Loading required package: MASS
genpwr.calc(calc = "power", model = "logistic", N = 2000, OR = 2,
Alpha = 0.05, MAF = c(0.1,0.2,0.3), Case.Rate = 0.5)
#> Test.Model True.Model MAF OR N_total N_cases N_controls Case.Rate
#> 1 Dominant Dominant 0.1 2 2000 1000 1000 0.5
#> 3 Dominant Additive 0.1 2 2000 1000 1000 0.5
#> 5 Dominant Recessive 0.1 2 2000 1000 1000 0.5
#> 7 Dominant Dominant 0.2 2 2000 1000 1000 0.5
#> 9 Dominant Additive 0.2 2 2000 1000 1000 0.5
#> 11 Dominant Recessive 0.2 2 2000 1000 1000 0.5
#> 13 Dominant Dominant 0.3 2 2000 1000 1000 0.5
#> 15 Dominant Additive 0.3 2 2000 1000 1000 0.5
#> 17 Dominant Recessive 0.3 2 2000 1000 1000 0.5
#> 12 Recessive Dominant 0.1 2 2000 1000 1000 0.5
#> 31 Recessive Additive 0.1 2 2000 1000 1000 0.5
#> 51 Recessive Recessive 0.1 2 2000 1000 1000 0.5
#> 71 Recessive Dominant 0.2 2 2000 1000 1000 0.5
#> 91 Recessive Additive 0.2 2 2000 1000 1000 0.5
#> 111 Recessive Recessive 0.2 2 2000 1000 1000 0.5
#> 131 Recessive Dominant 0.3 2 2000 1000 1000 0.5
#> 151 Recessive Additive 0.3 2 2000 1000 1000 0.5
#> 171 Recessive Recessive 0.3 2 2000 1000 1000 0.5
#> 14 Additive Dominant 0.1 2 2000 1000 1000 0.5
#> 32 Additive Additive 0.1 2 2000 1000 1000 0.5
#> 52 Additive Recessive 0.1 2 2000 1000 1000 0.5
#> 72 Additive Dominant 0.2 2 2000 1000 1000 0.5
#> 92 Additive Additive 0.2 2 2000 1000 1000 0.5
#> 112 Additive Recessive 0.2 2 2000 1000 1000 0.5
#> 132 Additive Dominant 0.3 2 2000 1000 1000 0.5
#> 152 Additive Additive 0.3 2 2000 1000 1000 0.5
#> 172 Additive Recessive 0.3 2 2000 1000 1000 0.5
#> 16 2df Dominant 0.1 2 2000 1000 1000 0.5
#> 33 2df Additive 0.1 2 2000 1000 1000 0.5
#> 53 2df Recessive 0.1 2 2000 1000 1000 0.5
#> 73 2df Dominant 0.2 2 2000 1000 1000 0.5
#> 93 2df Additive 0.2 2 2000 1000 1000 0.5
#> 113 2df Recessive 0.2 2 2000 1000 1000 0.5
#> 133 2df Dominant 0.3 2 2000 1000 1000 0.5
#> 153 2df Additive 0.3 2 2000 1000 1000 0.5
#> 173 2df Recessive 0.3 2 2000 1000 1000 0.5
#> Power_at_Alpha_0.05
#> 1 0.99997130
#> 3 0.99999117
#> 5 0.06094645
#> 7 0.99999997
#> 9 1.00000000
#> 11 0.12562959
#> 13 0.99999999
#> 15 1.00000000
#> 17 0.26400143
#> 12 0.23736708
#> 31 0.72802319
#> 51 0.32261174
#> 71 0.51913618
#> 91 0.99712300
#> 111 0.84110046
#> 131 0.65907220
#> 151 0.99999669
#> 171 0.99128361
#> 14 0.99994745
#> 32 0.99999535
#> 52 0.09704782
#> 72 0.99999973
#> 92 1.00000000
#> 112 0.39542984
#> 132 0.99999976
#> 152 1.00000000
#> 172 0.83339405
#> 16 0.99987562
#> 33 0.99997633
#> 53 0.24913314
#> 73 0.99999976
#> 93 1.00000000
#> 113 0.75849311
#> 133 0.99999996
#> 153 1.00000000
#> 173 0.97950882
"The return object contains information about power for additive, dominant, recessive, and 2df / genotypic tests of association, assuming various true underlying genetic effects (additive, dominant, recessive). "
Installation instructions
To install genpwr, perform the following steps:
- Install R version 3.5.1 or higher by following the instructions at https://www.R-project.org
- From the R environment, install and load the "genpwr" package:
install.packages("genpwr")
- Load the library
library(genpwr)
Demo
Install the genpwr package as described above.
Run the genpwr demo program
demo(genpwr_demo)