class RailsDataExplorer::Statistics::PearsonsChiSquaredIndependenceTest

In cases where the expected value, E, is found to be small (indicating a small underlying population probability, and/or a small number of observations), the normal approximation of the multinomial distribution can fail, and in such cases it is found to be more appropriate to use the G-test, a likelihood ratio-based test statistic. Where the total sample size is small, it is necessary to use an appropriate exact test, typically either the binomial test or (for contingency tables) Fisher's exact test. This test uses the conditional distribution of the test statistic given the marginal totals; however, it does not assume that the data were generated from an experiment in which the marginal totals are fixed and is valid whether or not that is the case.

Public Class Methods

new(data_matrix, min_probability = 0.05) click to toggle source
# File lib/rails_data_explorer/statistics/pearsons_chi_squared_independence_test.rb, line 61
def initialize(data_matrix, min_probability = 0.05)
end

Public Instance Methods

compute() click to toggle source
# File lib/rails_data_explorer/statistics/pearsons_chi_squared_independence_test.rb, line 64
def compute
end