R: Classical estimates for tables

stats {robCompositions} | R Documentation

## Classical estimates for tables

### Description

Some standard/classical (non-compositional) statistics

### Usage

    stats(x, margins = NULL, statistics = c("phi", "cramer", "chisq",
      "yates"), maggr = mean)

### Arguments

`x` | a data.frame, matrix or table
`margins` | margins
`statistics` | statistics of interest
`maggr` | a function for calculating the mean margins of a table, default is the arithmetic mean

### Details

statistics ‘phi’ is the values of the table divided by the product of margins. ‘cramer’ normalize these values according to the dimension of the table. ‘chisq’ are the expected values according to Pearson while ‘yates’ according to Yates.

For the `maggr` function argument, arithmetic means (`mean`) should be chosen to obtain the classical results. Any other user-provided functions should be take with care since the classical estimations relies on the arithmetic mean.

### Value

List containing all statistics

### 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)
    stats(precipitation)
    stats(precipitation, statistics = "cramer")
    stats(precipitation, statistics = "chisq")
    stats(precipitation, statistics = "yates")

    ## take with care
    ## (the provided statistics are not designed for that case):
    stats(precipitation, statistics = "chisq", maggr = gmean)

[Package robCompositions version 2.0.9 Index]