Graphics Reference
In-Depth Information
Figure . . Trellis display of the Accident Victims data. he same variables are presented here as
shown in Fig. .
Trellis displays and mosaicplots are very closely related from a conceptual point of
view. he multiple barchart variant of the mosaicplot is essentially a trellis display
of only categorical variables. he close relationship between mosaicplots and trellis
displays is probably most obvious for the example of the accident victim data shown
in Figs. . and . , where Fig. . is produced by the following lines of code:
> library(lattice)
> barchart(Observed~Age|Vehicle*Gender, data=acc)
he formula notation of R also fits with our notation of the plot's structure: the for-
mula y~x
gpcorresponds to a mosaicplot with a structure of g p ,...,
g , x, y, i.e., the order of the variables is inverted. Trellises are not very strict about
the actual layout ofthe panels, buta similar approach tothe default layout of mosaic-
plots - alternating between rows and columns, i.e., horizontal and vertical splits - is
generally used for trellis displays too.
he big difference between trellis displays and mosaics is, of course, the ability of
trellis displays to flexibly display observations using different display types, whereas
mosaics are restricted to counting the number of observations in each combination
oftheconditional variables andthendisplayingthisnumberasaproportionally sized
rectangle.
g
g
ċċċ
Pivot Tables
13.4.3
While pivot tables are not primarily a graphical technique, they are still closely re-
lated to mosaicplots and so are discussed here. Pivot tables are included in any Excel
distribution andarethereforewidelyavailable, although notwidelyused.Pivot tables
allow usto summarize categorical variables. Figure . showsExcel's pivot table as-
sistant: using drag and drop from a list of all variables, variables can be placed in the
Search WWH ::




Custom Search