table2x2: 2x2 table calculus for teaching

Description Usage Arguments Details Value Author(s) Examples

View source: R/table2x2.R

Description

2x2 table calculus for teaching

Usage

1
2
3
4
5
table2x2(
  x,
  digits = 1,
  stats = c("table", "rd", "rr", "or", "chisq", "fisher")
)

Arguments

x

2x2 table

digits

rounding digits

stats

subset or all of c("table","rd","or","rr","chisq","fisher") where rd= risk difference, rr = risk ratio, or = odds ratio, chisq = chi-square test, fisher= fisher's exact test and table = the 2x2 table

Details

2x2 table calculus for teaching

Value

see example

Author(s)

Thomas A. Gerds <tag@biostat.ku.dk>

Examples

1
2
3
table2x2(table("marker"=rbinom(100,1,0.4),"response"=rbinom(100,1,0.1)))
table2x2(matrix(c(71,18,38,8),ncol=2),stats="table")
table2x2(matrix(c(71,18,38,8),ncol=2),stats=c("rr","fisher"))

Publish documentation built on Jan. 8, 2021, 5:37 p.m.