Cross-Tabulation of Weighted or Unweighted Data
xt(data, var, byvar = NULL, controlvar = NULL, weight = NULL, ...)
Either a data frame or a survey design object.
Row variable for the cross-tabular.
Optional column variable for the cross-tabulation. If NULL
, a frequency and relative frequency distribution of var
will be produced.
The name of a categorical control variable.
A vector of weights to be applied to the table.
Other arguments to be passed down to make_assoc_stats
. You can use this to calculate different statistics. By default, you get Chi-squared, Cramer's V, Gamma and Kendall's Tau-b.
Produces a cross-tabulation and Chi-square statistic for weighted or unweighted data.
A list with two elements - table of class tabyl
and the returned results from svychisq
.