xt: Cross-Tabulation of Weighted or Unweighted Data

xtR Documentation

Cross-Tabulation of Weighted or Unweighted Data

Description

Cross-Tabulation of Weighted or Unweighted Data

Usage

xt(data, var, byvar = NULL, controlvar = NULL, weight = NULL, ...)

Arguments

data

Either a data frame or a survey design object.

var

Row variable for the cross-tabular.

byvar

Optional column variable for the cross-tabulation. If NULL, a frequency and relative frequency distribution of var will be produced.

controlvar

The name of a categorical control variable.

weight

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.

Value

A list with two elements - table of class tabyl and the returned results from svychisq.


davidaarmstrong/damisc documentation built on Oct. 1, 2023, 3:05 p.m.