Description Usage Arguments Value Author(s) See Also Examples
wtd.chi.sq
produces weighted chi-squared tests for two- and three-variable contingency tables. Decomposes parts of three-variable contingency tables as well. Note that weights run with the default parameters here treat the weights as an estimate of the precision of the information. A prior version of this software was set to default to mean1=FALSE
.
1 2 |
var1 |
|
var2 |
|
var3 |
|
weight |
|
na.rm |
|
drop.missing.levels |
|
mean1 |
|
A two-way chi-squared produces a vector including a single chi-squared value, degrees of freedom measure, and p-value for each analysis.
A three-way chi-squared produces a matrix with a single chi-squared value, degrees of freedom measure, and p-value for each of seven analyses. These include: (1) the values using a three-way contingency table, (2) the values for a two-way contingency table with each pair of variables, and (3) assessments for whether the relations between each pair of variables are significantly different across levels of the third variable.
Josh Pasek, Assistant Professor of Communication Studies at the University of Michigan (www.joshpasek.com).
1 2 3 4 5 6 7 8 9 10 | var1 <- c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3)
var2 <- c(1,1,2,2,3,3,1,1,2,2,3,3,1,1,2)
var3 <- c(1,2,3,1,2,3,1,2,3,1,2,3,1,2,3)
weight <- c(.5,.5,.5,.5,.5,1,1,1,1,1,2,2,2,2,2)
wtd.chi.sq(var1, var2)
wtd.chi.sq(var1, var2, weight=weight)
wtd.chi.sq(var1, var2, var3)
wtd.chi.sq(var1, var2, var3, weight=weight)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.