1.3. Graphical and Numerical Summaries of Multivariate Data 19 Defendant Bl Wh Figure 1.12. A mosaic plot of death penalty by race of defendant and victim. . It appears that black defendants are more likely to receive the death penalty when the victim is white and also when the victim is black, but not if we ignore the race of the victim. This sort of apparent contradiction is known as Simpson’s paradox. In this case, it appears that the death penalty is more likely to be given for a white victim, and since most victims are the same race as their murderer, the result is that overall white defendants are more likely (in this data set) to receive the death penalty even though black defendants are more likely (again, in this data set) to receive the death penalty for each race of victim. The fact that our understanding of the data is so dramatically influenced by whether or not our analysis includes the race of the victim is a warning to watch for lurking variables variables that have an important effect but are not included in our analysis in other settings as well. Part of the design of a good study is selecting the right things to measure. These cross tables can be visualized graphically using a mosaic plot. Mosaic plots can be generated with the core R function mosaicplot() or with mosaic() from the vcd package. (vcd is short for visualization of categorical data.) The latter is somewhat more flexible and usually produces more esthetically pleasing output. A number of different formula formats can be supplied to mosaic(). The results of the following code are shown in Figure 1.12. intro-deathPenalty03 require(vcd) mosaic(~Victim+Defendant+DeathPenalty,data=deathPen) structable(~Victim+Defendant+DeathPenalty,data=deathPen) Defendant Bl Wh Victim DeathPenalty Bl No 97 9 Yes 6 0 Wh No 52 132 Yes 11 19 As always, see ?mosaic for more information. The vcd package also provides an alternative to xtabs() called structable(), and if you print() a mosaic(), you will get both the graph and the table. Victim DeathPenalty Wh Yes No Bl Yes No
Previous Page Next Page