meanridits {ridittools}R Documentation

Compute mean ridits of multiple groups

Description

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.

Usage

meanridits(x, margin, ref = NULL)

Arguments

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

Value

vector of mean ridits

Note

using group totals as reference will not give meaningful results if data are proportions

Author(s)

Eric Bohlman

Examples

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))
  }

[Package ridittools version 0.1 Index]