Gallup {BSDA} | R Documentation |
Data for Exercise 2.76
Gallup
A data frame with 4 observations on the following 16 variables.
Gender
Female
Male
Crime1
No.Crime1
No.Opinion1
Education
College
Grade School
High School
Crime2
No.Crime2
No.Opinion2
Age
18-24
25-29
30-49
50-older
Crime3
No.Crime3
No.Opinion3
Religion
Catholic
Protestant
Crime4
No.Crime4
No.Opinion4
Kitchens, L. J. (2003) Basic Statistics and Data Analysis. Duxbury
INFO <- c(43,52,5,42,53,5,44,51,5,30,67,3,45,50,5,58,33,9,27,67,6,26,70,4,45, 52,3,54,39,7,49,47,4,39,55,6) INFOmat <- matrix(INFO,nrow=12,byrow=TRUE) INFOmat rownames(INFOmat) <- c("National","Gender: Male","Gender: Female", "Education: College","Education: High School","Education: Grade School", "Age: 18-24", "Age: 25-29", "Age: 30-49", "Age: 50-older", "Religion: Protestant", "Religion: Catholic") colnames(INFOmat) <- c("Criminal", "Not.Criminal", "No.Opinion") INFOmat barplot(t(INFOmat[2:3,]),beside=TRUE,legend=TRUE,names=c("Male","Female"), ylab="Percent of Population Opining") barplot((INFOmat[2:3,]),beside=TRUE,legend=TRUE,ylab="Percent of Population Opining" ) remove(INFO,INFOmat)