genpwr.calc: Function to Calculate Power for Linear Models with logistic...

Description Usage Arguments Value Examples

View source: R/genpwr_wrapper.R

Description

Calculates the power to detect an difference in means/effect size/regression coefficient, at a given sample size, N, with type 1 error rate, Alpha

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
genpwr.calc(
  calc,
  model,
  ge.interaction = NULL,
  N = NULL,
  Power = NULL,
  MAF = NULL,
  Alpha = 0.05,
  P_e = NULL,
  sd_e = NULL,
  sd_y = NULL,
  Case.Rate = NULL,
  k = NULL,
  OR = NULL,
  OR_G = NULL,
  OR_E = NULL,
  OR_GE = NULL,
  risk_allele = TRUE,
  ES = NULL,
  ES_G = NULL,
  ES_E = NULL,
  ES_GE = NULL,
  R2 = NULL,
  R2_G = NULL,
  R2_E = NULL,
  R2_GE = NULL,
  True.Model = "All",
  Test.Model = "All"
)

Arguments

calc

What kind of calculation to perform? sample size ("ss"), power ("power"), or effect size ("es")

model

Distribution of the outcome variable? ("logistic" or "linear")

ge.interaction

If no environment interaction, should be NULL, otherwise should be "logistic" or "linear"

N

Vector of the desired sample size(s)

Power

Vector of the desired power(s)

MAF

Vector of minor allele frequencies

Alpha

the desired type 1 error rate(s)

P_e

Vector of proportions of the population with exposure to the environmental effect

sd_e

Standard deviation of the environmental variable

sd_y

Standard deviation of the outcome in the population (ignoring genotype). Either sd_y_x or sd_y must be specified.

Case.Rate

Case Rate of the outcome in the population (ignoring genotype). Either Case.Rate_x or Case.Rate must be specified.

k

Vector of the number of controls per case. Either k or Case.Rate must be specified.

OR

Vector of genetic odds ratios to detect in absence of environmental odds ratios

OR_G

Vector of genetic odds ratios to detect

OR_E

Vector of environmental odds ratios to detect

OR_GE

Vector of genetic/environmental interaction odds ratios to detect

risk_allele

Logical: If OR > 1, the allele is classified as a "risk allele"

ES

Vector of effect sizes (difference in means) to detect. Either ES or R2 must be specified.

ES_G

Vector of genetic effect sizes (difference in means) to detect. Either ES_G, ES_E, and ES_EG or R2_G, R2_E, and R2_EG must be specified.

ES_E

Vector of environmental effect sizes (difference in means) to detect. Either ES_G, ES_E, and ES_EG or R2_G, R2_E, and R2_EG must be specified.

ES_GE

Vector of genetic/environment interaction effect sizes (difference in means) to detect. Either ES_G, ES_E, and ES_EG or R2_G, R2_E, and R2_EG must be specified.

R2

Vector of R-squared values to detect. Either ES or R2 must be specified.

R2_G

Vector of genetic R-squared values to detect. Either ES_G, ES_E, and ES_EG or R2_G, R2_E, and R2_EG must be specified.

R2_E

Vector of environmental R-squared values to detect. Either ES_G, ES_E, and ES_EG or R2_G, R2_E, and R2_EG must be specified.

R2_GE

Vector of genetic/environment interaction R-squared values Either ES_G, ES_E, and ES_EG or R2_G, R2_E, and R2_EG must be specified.

True.Model

A vector specifying the true underlying genetic model(s): 'Dominant', 'Additive', 'Recessive' or 'All'

Test.Model

A vector specifying the assumed genetic model(s) used in testing: 'Dominant', 'Additive', 'Recessive' or 'All'

Value

A data frame including the power for all combinations of the specified parameters (Case.Rate, ES, Power, etc)

Examples

1
2
3
4
pw <- genpwr.calc(calc = "power", model = "logistic", ge.interaction = "continuous",
	N=100, OR_G=2, OR_E=1.4, OR_GE=c(1.5, 2), 
	sd_e = 1.1, MAF=0.1, Case.Rate = 0.3, Alpha=0.05,
	True.Model="All", Test.Model=c("Dominant", "Recessive"))

genpwr documentation built on March 31, 2021, 1:06 a.m.