
Last chance! 50% off unlimited learning
Sale ends in
### Opinions on Pre- and Extramarital Sex, Agresti (2002), page 421
opinions <- c("always wrong", "almost always wrong",
"wrong only sometimes", "not wrong at all")
PreExSex <- as.table(matrix(c(144, 33, 84, 126,
2, 4, 14, 29,
0, 2, 6, 25,
0, 0, 1, 5), nrow = 4,
dimnames = list(PremaritalSex = opinions,
ExtramaritalSex = opinions)))
### treating response as nominal
mh_test(PreExSex)
### and as ordinal
mh_test(PreExSex, scores = list(response = 1:length(opinions)))
Run the code above in your browser using DataLab