# NOT RUN {
### Example from Essential Medical Statistics
# Page 178, Chapter 18: Controlling for confounding: Stratification
lepto <- expandtbl(
male = c(36, 14, 50, 50), female = c(24, 126, 10, 90),
exp_name = "area", exp_lvl = c("Rural", "Urban"),
case_name = "ab", case_lvl = c("Yes", "No"),
strata_name = "gender"
)
## label variables and data
lepto <- label(lepto, "Prevalence survey of leptospirosis in West Indies")
lepto <- label(lepto, area="Type of area", ab = "Leptospirosis Antibodies",
gender="Gener: Male or Female")
## Calculate OR
mhor(lepto, area, ab)
## Calculate MHOR
mhor(lepto, area, ab, gender)
# }
Run the code above in your browser using DataLab