The data set Abortion in vcdExtra gives a 2 × 2 × 2 table of opinions regarding abortion in relation to sex and status of the respondent. This table has the following structure:
data("Abortion", package = "vcdExtra")
library(vcd)
## Loading required package: grid
library(vcdExtra)
## Loading required package: gnm
str(Abortion)
## table [1:2, 1:2, 1:2] 171 152 138 167 79 148 112 133
## - attr(*, "dimnames")=List of 3
## ..$ Sex : chr [1:2] "Female" "Male"
## ..$ Status : chr [1:2] "Lo" "Hi"
## ..$ Support_Abortion: chr [1:2] "Yes" "No"
fourfoldplot(aperm(Abortion, c(3,1,2)))
fourfoldplot(aperm(Abortion, c(3, 2, 1 )))
oddsratio(aperm(Abortion, c(3, 1,2 )))
## log odds ratios for Support_Abortion and Sex by Status
##
## Lo Hi
## 0.74554746 -0.01888987
oddsratio(aperm(Abortion, c(3, 2, 1 )))
## log odds ratios for Support_Abortion and Status by Sex
##
## Female Male
## 0.5634609 -0.2009764
In low status group, males are less likly to support abortion than females. In high status groups, male and female attitute towards abortion are similar. Low status females are more likely to support abortion than high status female. Low status males are slightly less likely to support abortion than high status males.
Agresti and Winner (1997) gave the data in below on the ratings of 160 movies by the reviewers Gene Siskel and Roger Ebert for the period from April 1995 through September 1996. The rating categories were Con (“thumbs down”), Mixed, and Pro (“thumbs up”).
ratings = matrix(c(24,8,13,8,13,11,10,9,64),ncol=3,byrow=TRUE)
rownames(ratings) = c("Con","Mixed","Pro")
colnames(ratings) = c("Con","Mixed","Pro")
addmargins(ratings)
## Con Mixed Pro Sum
## Con 24 8 13 45
## Mixed 8 13 11 32
## Pro 10 9 64 83
## Sum 42 30 88 160
Kappa(ratings)
## value ASE z Pr(>|z|)
## Unweighted 0.3888 0.05979 6.503 7.870e-11
## Weighted 0.4269 0.06350 6.723 1.781e-11
agreementplot(ratings, main="Unweighted")
agreementplot(ratings, main="Weighted")