meanridits: Compute mean ridits of multiple groups

Description Usage Arguments Value Note Author(s) Examples

View source: R/meanridits.R

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

1
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

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

ridittools documentation built on May 1, 2019, 6:30 p.m.