table2x2: 2x2 table calculus for teaching

View source: R/table2x2.R

table2x2R Documentation

2x2 table calculus for teaching

Description

2x2 table calculus for teaching

Usage

table2x2(
  x,
  digits = 1,
  conf.level = 0.95,
  stats = c("table", "rd", "rr", "or", "chisq", "fisher")
)

Arguments

x

2x2 table

digits

rounding digits

conf.level

Confidence level used for constructing confidence intervals. Default is 0.95.

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

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. 18, 2023, 1:08 a.m.