powered by
tabOdds generates cross-tabulation between two variables and display odds of failure var_case among exposure variable var_exp. It is used in case-control studies.
tabOdds
var_case
var_exp
tabOdds( data, ..., by, exp_value = NULL, case_value = NULL, plot = TRUE, na.rm = FALSE, rnd = 3 )
Dataset
Variable or multiple variables Colon separator : can be used to specify multiple variables.
:
Varaiable for cross-tabulation
value for exposure as reference
value for outcome as reference
logical value to display plots of rates across a categorical variable
A logical value to specify missing values, NA in the table
NA
specify rounding of numbers. See round.
round
A table tabulating odds and corresponding 95\ is generated.
Formula for calculating Odds
$$OR = d1 x h0 / d0 x h1$$
Error Factor (EF)
$$EF = exp(1.96 x SE(log odds))$$
$$SE(log odds) = \sqrt{1/d + 1/h}$$
Betty R. Kirkwood, Jonathan A.C. Sterne (2006, ISBN:978<U+2013>0<U+2013>86542<U+2013>871<U+2013>3)
B. Burt Gerstman (2013, ISBN:978-1-4443-3608-5)
Douglas G Altman (2005, ISBN:0 7279 1375 1)
# NOT RUN { ## use infert data data(infert) tabOdds(infert, education, by = case, plot = FALSE) # }
Run the code above in your browser using DataLab