# NOT RUN {
## Asthma Example from Essential Medical Statistics
## page 160
asthma <- expandTables(c(81, 995, 57, 867),
exp_name = "sex",
exp_lvl = c("woman", "man"),
case_name = "asthma",
case_lvl = c("yes", "no"))
## label variable and dataset
asthma <- labelData(asthma, "Hypothetical Data of Asthma Prevalence")
asthma <- labelVar(asthma, c(sex, asthma), c("Man or Woman", "Asthma or No Asthma"))
## Checking codebook
codebook(asthma)
## simple tabulation
tab(asthma)
## cross-tabulation
tab(asthma, sex, by = asthma)
# }
Run the code above in your browser using DataLab