powered by
Generates cross-tabulation of dependent and indendent variables, also creates a mosiac plot. Makes use of the crosstab function in the descr package.
xtp( data, y, x, w = NULL, ylab = NULL, xlab = NULL, main = NULL, digits = 2, chisq = FALSE )
Dataset (like gss, nes, states, or world)
Dependent variable
Independent variable
Weights (optional)
Y-axis label (optional)
X-axis label (optional)
Main label for plot (optional)
Number of digits to report after decimal place, optional (default = 2)
Do you want Chi-Squared test reported? (default is FALSE)
A data frame of the cross tabulation results
# NOT RUN { library(poliscidata) xtp(gss, grass, attend3, wtss) # }
Run the code above in your browser using DataLab