statistics-0.10.3.1: A library of statistical types, data, and functions

Safe Haskell | None

Statistics.Test.ChiSquared

Contents

- Data types

Description

Pearson's chi squared test.

Synopsis

- chi2test :: (Vector v (Int, Double), Vector v Double) => Double -> Int -> v (Int, Double) -> TestResult
- data TestType
  - = OneTailed
  - | TwoTailed
- data TestResult
  - = Significant
  - | NotSignificant

# Documentation

chi2test

Arguments

:: (Vector v (Int, Double), Vector v Double) |
=> Double | p-value
-> Int | Number of additional degrees of freedom. One degree of freedom is due to the fact that the are N observation in total and accounted for automatically.
-> v (Int, Double) | Observation and expectation.
-> TestResult |

Generic form of Pearson chi squared tests for binned data. Data sample is supplied in form of tuples (observed quantity, expected number of events). Both must be positive.

# Data types

data TestType

Test type. Exact meaning depends on a specific test. But generally it's tested whether some statistics is too big (small) for `OneTailed` or whether it too big or too small for `TwoTailed`

Constructors

OneTailed |
TwoTailed |

Instances

Eq TestType |
Ord TestType |
Show TestType |
Typeable TestType |

data TestResult

Result of hypothesis testing

Constructors

Significant | Null hypothesis should be rejected
NotSignificant | Data is compatible with hypothesis

Instances

Eq TestResult |
Ord TestResult |
Show TestResult |
Typeable TestResult |