Graphics Reference
In-Depth Information
mission rates was because women were more likely to apply to competitive departments with
lower admission rates.
In Figures 13-28 and 13-29 , you can see that within each department, admission rates were ap-
proximately equal between men and women. You can also see that departments with higher ad-
mission rates (A and B) were very imbalanced in the gender ratio of applicants: far more men
applied to these departments than did women. As you can see, partitioning the data in differ-
ent orders and directions can bring out different aspects of the data. In Figure 13-29 , as in Fig-
ure 13-28 , it's easy to compare male and female admission rates within each department and
across departments. Splitting Dept vertically, Gender horizontally, and Admit horizontally, as in
Figure 13-30 , makes it difficult to compare male and female admission rates within each depart-
ment, but it is easy to compare male and female application rates across departments.
See Also
See ?mosiacplot for another function that can create mosaic plots.
P.J. Bickel, E.A. Hammel, and J.W. O'Connell, “Sex Bias in Graduate Admissions: Data from
Berkeley,” Science187 (1975): 398-404.
Creating a Pie Chart
Problem
You want to make a pie chart.
Solution
Use the pie() function. In this example ( Figure 13-31 ), we'll use the survey data set from the
MASS library:
library(MASS) # For the data set
# Get a table of how many cases are in each level of fold
fold <- table(survey$Fold)
fold
L on R Neither R on L
99
18
120
# Make the pie chart
pie(fold)
Search WWH ::




Custom Search