| stats {robCompositions} | R Documentation |
Some standard/classical (non-compositional) statistics
stats(x, margins = NULL, statistics = c("phi", "cramer", "chisq", "yates"),
maggr = mean)
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 |
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.
List containing all statistics
Matthias Templ
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
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)