| Vietnam {vcdExtra} | R Documentation |
A survey of student opinion on the Vietnam War was taken at the University of North Carolina at Chapel Hill in May 1967 and published in the student newspaper. Students were asked to fill in ballot papers stating which policy out of A,B,C or D they supported. Responses were cross-classified by gender/year.
The result is a 2 x 5 x 4 contingency table (as a data frame in frequency form), with factors
sex, yr and resp.
data(Vietnam)
A data frame in frequency form with 40 observations on the following 4 variables.
sexa factor with levels F M
yran ordered factor with levels Fresh < Soph < Jr < Sr < Grad
respa factor with levels A B C D
Freqa numeric vector
The response categories can be considered ordered in terms of attitude about the war in Vietnam:
defeat North Vietnam by widespread bombing and land invasion
follow the present policy
withdraw troops to strong points and open negotiations on elections involving the Viet Cong
immediate withdrawal of all U.S. troops
Aitkin, M. A., Anderson, D., Francis, B., & Hinde, J. Statistical Modelling in GLIM, Clarendon Press, 1989
Friendly, M. Visualizing Categorical Data, Cary, NC: SAS Institute, 2000, Appendix B.12.
data(Vietnam) str(Vietnam) # make it into a table Vietnam.table <- xtabs(Freq ~ sex+yr+resp, data=Vietnam) structable(Vietnam.table) # mosaic plots for mutual independence mosaic(Vietnam.table, shade=TRUE) mosaic(Vietnam.table, gp=shading_Friendly)