# NOT RUN {
# prepare sample data set
data(efc)
# print simple cross table with labels
# }
# NOT RUN {
sjt.xtab(efc$e16sex, efc$e42dep)
# print cross table with manually set
# labels and expected values
sjt.xtab(efc$e16sex, efc$e42dep, var.labels = c("Elder's gender",
"Elder's dependency"), value.labels = list(efc.labels[['e16sex']],
efc.labels[['e42dep']]), show.exp = TRUE)
# print minimal cross table with labels, total col/row highlighted
sjt.xtab(efc$e16sex, efc$e42dep, show.cell.prc = FALSE, emph.total = TRUE)
# User defined style sheet
sjt.xtab(efc$e16sex, efc$e42dep,
CSS = list(css.table = "border: 2px solid;",
css.tdata = "border: 1px solid;",
css.horline = "border-bottom: double blue;"))
# }
# NOT RUN {
# ordinal data, use Kendall's tau
sjt.xtab(efc$e42dep, efc$quol_5, statistics = "kendall")
# calculate Spearman's rho, with continuity correction
sjt.xtab(
efc$e42dep,
efc$quol_5,
statistics = "spearman",
exact = FALSE,
continuity = TRUE
)
# }
Run the code above in your browser using DataLab