indTab {robCompositions}R Documentation

Independence table

Description

Estimates the expected frequencies from an m-way table under the null hypotheses of independence.

Usage

indTab(x, margin = c("gmean_sum", "sum"), frequency = c("relative",
  "absolute"), pTabMethod = c("dirichlet", "half", "classical"))

Arguments

x

an object of class table

margin

determines how the margins of the table should be estimated (default via geometric mean margins)

frequency

indicates whether absolute or relative frequencies should be computed.

pTabMethod

to estimate the propability table. Default is ‘dirichlet’. Other available methods: ‘classical’ that is function prop.table() from package base or method “half” that add 1/2 to each cell to avoid zero problems.

Details

Because of the compositional nature of probability tables, the independence tables should be estimated using geometric margins.

Value

The independence table(s) with either relative or absolute frequencies.

Author(s)

Matthias Templ

References

Juan Jose Egozcuea, Vera Pawlowsky-Glahn, Matthias Templ, Karel Hron (2015) Independence in Contingency Tables Using Simplicial Geometry. Communications in Statistics - Theory and Methods, Vol. 44 (18), 3978–3996. DOI:10.1080/03610926.2013.824980

Examples

data(precipitation) 
tab1 <- indTab(precipitation)
tab1
sum(tab1)

## Not run: 
data("PreSex", package = "vcd")
indTab(PreSex)

## End(Not run)

[Package robCompositions version 2.0.6 Index]