Description Usage Arguments Value Note Author(s) Examples
Computes mean ridits of multiple groups in a crosstab matrix. Groups can be either rows or columns, with the other dimension representing the response categories.
1 | meanridits(x, margin, ref = NULL)
|
x |
matrix of cross-tabulated counts or proportions |
margin |
1 for groups in rows, 2 for groups in columns |
ref |
if omitted, use totals across groups as reference group if vector of counts (or proportions), use as reference group otherwise, number (or name if it exists) of group to use as reference |
vector of mean ridits
using group totals as reference will not give meaningful results if data are proportions
Eric Bohlman
1 2 3 4 5 6 7 8 9 10 | meanridits(flu.age, 2)
meanridits(flu.age, 2, "H3")
meanridits(handgun, 2, 1)
meanridits(handgun, 2, rowSums(handgun[ , 2:4]))
## The function is currently defined as
function (x, margin, ref = NULL)
{
apply(x, margin, meanridit, riditsrefgroup(x, margin, ref))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.