binChi | R Documentation |
These functions compute statistics based on observed and expected counts for a list of bins.
binChi(bins, agg = sum)
binMI(bins, agg = sum)
binAbsDif(bins, agg = sum)
bins |
a list of bins, each a list with elements 'x', 'y', 'depth', 'bnds' (list with elements 'x' and 'y'), 'expn', 'n' |
agg |
function which is aggregates the individual statistics computed over each bin |
Binstatistics
Three functions are provided by default, 'binChi' computes the chi-squared statistic by taking the squared difference between observed and expected counts and dividing this by the expected counts. 'binMi' computes the mutual information for each bin using the observed and expected counts. Finally, 'binAbsDif' computes the absolute difference between observed and expected counts. Each function first computes a value on every bin independently and stores all these values in memory before using the function provided in the optional argument 'agg' to aggregate these values.
A list with elements 'residuals', 'stat', and 'nbins' reporting the individual statistic values (possibly transformed), the aggegrated statistic value, and the number of bins in 'bins'
binChi()
: Chi-squared statistic
binMI()
: Mutual information
binAbsDif()
: Absolute difference between observed
and expected
Chris Salahub
binList1 <- list(list(x = c(1,2), y = c(3,1), depth = 1, n = 2,
expn = 2),
list(x = c(3,4), y = c(2,4), depth = 1, n = 2,
expn = 2))
binList2 <- list(list(x = c(1,2), y = c(3,1), depth = 6, n = 2,
expn = 4),
list(x = c(), y = c(), depth = 1, n = 0, expn = 1))
binChi(binList1)
binChi(binList2)
binMI(binList1)
binMI(binList2)
binAbsDif(binList2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.