ss.calc: Function to Calculate Sample Size

Description Usage Arguments Value Examples

View source: R/sample_size_function.R

Description

Calculates the necessary sample size to achieve the specified level of power to detect an odds ratio, OR, with type 1 error rate, Alpha

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ss.calc(
  power = 0.8,
  Case.Rate = NULL,
  k = NULL,
  MAF = NULL,
  OR = NULL,
  Alpha = 0.05,
  True.Model = "All",
  Test.Model = "All"
)

Arguments

power

Vector of the desired power(s)

Case.Rate

Vector of the proportion(s) of cases in the sample (cases/(cases + controls)). Either k or Case.Rate must be specified.

k

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

MAF

Vector of minor allele frequencies

OR

Vector of odds ratios to detect

Alpha

the desired type 1 error rate(s)

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 total number of subjects required for all combinations of the specified parameters (Case.Rate, OR, Power, etc)

Examples

1
2
3
ss <- ss.calc(power=0.8, Case.Rate=0.5, k=NULL,
   MAF=0.1, OR=3,Alpha=0.05,
   True.Model='All', Test.Model='All')

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