ss.calc.linear: Function to Calculate Sample Size in Linear Models

Description Usage Arguments Value Examples

View source: R/linear_sample_size_functions.R

Description

Calculates the necessary sample size to acheive the specified level of power to detect an effect size, ES or R2 value, with type 1 error rate, Alpha

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ss.calc.linear(
  power = 0.8,
  MAF = NULL,
  ES = NULL,
  R2 = NULL,
  sd_y = NULL,
  Alpha = 0.05,
  True.Model = "All",
  Test.Model = "All"
)

Arguments

power

Vector of the desired power(s)

MAF

Vector of minor allele frequencies

ES

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

R2

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

sd_y

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

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

Examples

1
2
3
ss <- ss.calc.linear(power=0.8,MAF=0.1,
    ES=3, R2=NULL, sd_y = 1,Alpha=0.05,
    True.Model='All', Test.Model='All')

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