burden_test: Carry out a Fisher's exact test

Description Usage Arguments Details Value Author(s) Examples

View source: R/burden_test.r

Description

Burden test with formatting step to make a contingency table

Usage

1
2
3
4
5
6
7
8
9
burden_test(
  car = NULL,
  status = NULL,
  n1 = NULL,
  n2 = NULL,
  ss1 = NULL,
  ss2 = NULL,
  alternative = "greater"
)

Arguments

car

vector of carrier status. 0 for non-carriers. 1 for carriers.

status

vector of cohort status. 0 for controls. 1 for cases.

n1

number of carriers cases

n2

number of carriers controls

ss1

sample size cases

ss2

sample size controls

alternative

indicates the alternative hypothesis and must be one of "two.sided", "greater" or "less".

Details

Fisher.test from base R with extra formatting steps.

For a one-sided test i.e. excess in cases, use the default alternative="greater"

Use $p for p-value Use $est for odds-ratio Use $conf.int[1:2] for 95

Value

Returns an object of class htest - use $p for p-value

Author(s)

Adam Waring - adam.waring@msdtc.ox.ac.uk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# For the simple case where you have the vector status (binary case or control) and a vector of whether they
have a variant 'car' (presumably after filtering) then;

N = 100
car = sample(c(0, 1), N, rep=T)
status = sample(c(0, 1), N, rep=T)

burden_test(car, status)

burden_test(n1=10, n2=20, ss1=100, ss2=100)

adamwaring/POSBURDEN documentation built on Feb. 21, 2020, 11:21 a.m.