powered by
This function makes use of the crosstab function from the descr package
xtp.chi2(data, y, x, w = NULL, digits = 1, prop.c = FALSE)
Dataset to be sorted
Dependent variable
Independent variable
Weights (optional)
Number of digits to report after decimal place, optional (default = 1).
Do you want column percentages reported in table? (default is FALSE)
Returns a data frame of cross tabulation results
# NOT RUN { library(poliscidata) xtp.chi2(gss, pornlaw, attend3, wtss) # }
Run the code above in your browser using DataLab