powphenanc: Power Estimate for Trait Ancestry Associations

View source: R/main_anc.R

powphenancR Documentation

Power Estimate for Trait Ancestry Associations

Description

Estimates power for significant associations between a binary trait and global ancestries.

Usage

powphenanc(
  incidence.rates,
  N.adm = 3e+05,
  anc.matrix,
  n = 1000,
  case.size = 750,
  control.size = 750,
  h2 = 1,
  liability = NA,
  anc.names = NA
)

Arguments

incidence.rates

A vector of incidence rates for the ancestral populations.

N.adm

Size of simulated individuals from which cases and controls are drawn from. Default is 3e5.

anc.matrix

A sample matrix of global ancestries, where rows represent samples and each column is one ancestry. See the format from the output of AncBetaOut function. If an ancestry matrix from empirical estimates is not available, AncBetaOut can be used to supply ancestry draws from simulations.

n

Iteration number of phenotype-ancestry regression tests. Each iteration is an independent simulation of phenotypes and ancestries for case and controls. Default 1000.

case.size

Number of cases. Default 750.

control.size

Number of controls. Default 750.

h2

Heritability. Default 1.

liability

Liability of the binary trait, used for defining cases and controls. If left as NA (default), then a proxy phenotype based on ancestry and incidence rates is used to reflect the probability of becoming cases.

anc.names

A vector of names for each ancestry, e.g. South Asian, West African, etc. It can be left unspecified (NA as default).

Value

A list of the following components:

ancestry Name of ancestries
liability_model If a liability treshold model has been used
powers Power per ancestry

See Also

AncBetaOut

Examples

# sample ancestries for a size of 100
aa_anc <- AncBetaOut(0.75, 0.01, 100)
# simulate phenotype-ancestry associations aa_ancp <- powphenanc(incidence.rates=c(0.01, 0.05), anc.matrix=aa_anc, h2=0.5, anc.names=c("eur","waf"))
# check powers anc_powers <- aa_ancp$powers

menglin44/APRICOT documentation built on July 1, 2023, 4:01 p.m.