Learn R Programming

poliscidata (version 2.3.0)

xtp.chi2: Cross tabulation Analysis with Chi-Squared Statistic

Description

This function makes use of the crosstab function from the descr package

Usage

xtp.chi2(data, y, x, w = NULL, digits = 1, prop.c = FALSE)

Arguments

data

Dataset to be sorted

y

Dependent variable

x

Independent variable

w

Weights (optional)

digits

Number of digits to report after decimal place, optional (default = 1).

prop.c

Do you want column percentages reported in table? (default is FALSE)

Value

Returns a data frame of cross tabulation results

Examples

Run this code
# NOT RUN {
   library(poliscidata)
   
   xtp.chi2(gss, pornlaw, attend3, wtss)
# }

Run the code above in your browser using DataLab