Class: RailsDataExplorer::Statistics::PearsonsChiSquaredIndependenceTest

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_data_explorer/statistics/pearsons_chi_squared_independence_test.rb

Overview

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.

Instance Method Summary collapse

Constructor Details

#initialize(data_matrix, min_probability = 0.05) ⇒ PearsonsChiSquaredIndependenceTest

Returns a new instance of PearsonsChiSquaredIndependenceTest.



64
65
# File 'lib/rails_data_explorer/statistics/pearsons_chi_squared_independence_test.rb', line 64

def initialize(data_matrix, min_probability = 0.05)
end

Instance Method Details

#computeObject



67
68
# File 'lib/rails_data_explorer/statistics/pearsons_chi_squared_independence_test.rb', line 67

def compute
end