Describing the relationships between two categorical variables is done somewhat less often than the other two broad types of bivariate analyses, but it is just as fun (and useful)!
To explore this technique, we will be using the dataset UCBAdmissions,
which contains the data on graduate school applicants to the University of California Berkeley in 1973.
Before we get started, we have to wrap the dataset in a call to data.frame
for coercing it into a data frame type variable—I'll explain why, soon.
ucba <- data.frame(UCBAdmissions) > head(ucba) Admit Gender Dept Freq 1 Admitted Male A 512 2 Rejected Male A 313 3 Admitted Female A 89 4 Rejected Female A 19 5 Admitted Male B 353 6 Rejected Male B 207
Now, what we want is a count of the frequencies of number of students in each of the following four categories:
Accepted female
Rejected female
Accepted male
Rejected male
Do you remember the frequency...