epitable: Cross tabulation ( 2by2 table).

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/freq.R

Description

epitable Display a cross tabulation of two variables optionnaly with row or col percentages. Chi Square with associated p.value are calculated. If table contain binary variable, then epiorder function is apply on the two variable to get a resulting table compatible with usual epidemiology interpretation. 0/1 variables are transformed into Yes/No and Yes is displayed before No Exposed Cases appear on upper left part of the table.

Usage

1
epitable(out, exp, missing = FALSE, row = FALSE, col = FALSE, fisher = TRUE)

Arguments

out

"Outcome" as numbers, factors or text

exp

"Exposure" as numbers, factors or text. short syntax is available see help(epifield)

missing

Boolean if FALSE, missing are not included in the table. A summary output of number of missing values is added at the end

row

"Row percentages"

col

"Col percentages"

fisher

TRUE by default, display the fisher exact probability. If table is larger than 2*2 then Fisher is not calculated

Value

An array containing values of ...

Author(s)

Gilles Desve

References

Based on: Epi6 and Stata functionnality, available at https://github.com/.

See Also

freq for frequency distributions

Examples

1
#' epitable(c(1,1,2,2,1),c(3,3,4,4,4))

gdesve/epifield documentation built on Jan. 23, 2022, 10:03 a.m.