epiHomog | R Documentation |
Calculates chi-square test statistic and p-value for risk differences and risk ratios of stratified 2x2 tables.
epiHomog(tab, metric = "Risk Difference")
tab |
a table object |
metric |
"Risk Difference" or "Risk Ratio" |
For calculation to be correct, table must be formatted same as those used for epi.2by2(), where counts for the outcome of interest and the exposed group appear in the upper-left corner of each stratified table.
If your 2x2 tables are composed of factors where the referent variable is level 0 and the index group is level 1, use flipTable() to re-orient to the format required here.
test statistic and p-value
food <- dplyr::tibble( fruits = sample(c("Orange", "Tomato"), 100, replace = TRUE), vegs = sample(c("Okra", "Fingernails"), 100, replace = TRUE), grain = sample(c("Baked", "Raw", "Monsanto"), 100, replace = TRUE)) tab <- flipTable(table(food)) epiHomog(tab)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.