data(Bartlett)
# measures of association
assocstats(Bartlett)
oddsratio(Bartlett)
# Test models
## Independence
MASS::loglm(formula = ~Alive + Time + Length, data = Bartlett)
## No three-way association
MASS::loglm(formula = ~(Alive + Time + Length)^2, data = Bartlett)
# Use woolf_test() for a formal test of homogeneity of odds ratios
vcd::woolf_test(Bartlett)
# Plots
fourfold(Bartlett, mfrow=c(1,2))
mosaic(Bartlett, shade=TRUE)
pairs(Bartlett, gp=shading_Friendly)
Run the code above in your browser using DataLab