Learn R Programming

Publish (version 2017.10.24)

table2x2: 2x2 table calculus for teaching

Description

2x2 table calculus for teaching

Usage

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

Value

see example

Details

2x2 table calculus for teaching

Examples

Run this code
# NOT RUN {
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"))
# }

Run the code above in your browser using DataLab