Statistics.Test.ChiSquared

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

Safe Haskell | None
Language | Haskell98

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 # |
Methods (==) :: TestType -> TestType -> Bool # (/=) :: TestType -> TestType -> Bool #
Data TestType # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TestType -> c TestType # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TestType # toConstr :: TestType -> Constr # dataTypeOf :: TestType -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c TestType) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TestType) # gmapT :: (forall b. Data b => b -> b) -> TestType -> TestType # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TestType -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TestType -> r # gmapQ :: (forall d. Data d => d -> u) -> TestType -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> TestType -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TestType -> m TestType # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TestType -> m TestType # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TestType -> m TestType #
Ord TestType # |
Methods compare :: TestType -> TestType -> Ordering # (<) :: TestType -> TestType -> Bool # (<=) :: TestType -> TestType -> Bool # (>) :: TestType -> TestType -> Bool # (>=) :: TestType -> TestType -> Bool # max :: TestType -> TestType -> TestType # min :: TestType -> TestType -> TestType #
Show TestType # |
Methods showsPrec :: Int -> TestType -> ShowS # show :: TestType -> String # showList :: [TestType] -> ShowS #
Generic TestType # |
Associated Types type Rep TestType :: * -> * # Methods from :: TestType -> Rep TestType x # to :: Rep TestType x -> TestType #
FromJSON TestType # |
Methods parseJSON :: Value -> Parser TestType # parseJSONList :: Value -> Parser [TestType] #
ToJSON TestType # |
Methods toJSON :: TestType -> Value # toEncoding :: TestType -> Encoding # toJSONList :: [TestType] -> Value # toEncodingList :: [TestType] -> Encoding #
type Rep TestType # |
type Rep TestType = D1 (MetaData "TestType" "Statistics.Test.Types" "statistics-0.13.3.0-A6M5lvDj6Zg1bzI7OU7tSj" False) ((:+:) (C1 (MetaCons "OneTailed" PrefixI False) U1) (C1 (MetaCons "TwoTailed" PrefixI False) U1))

data TestResult #

Result of hypothesis testing

Constructors

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

Instances

Eq TestResult # |
Methods (==) :: TestResult -> TestResult -> Bool # (/=) :: TestResult -> TestResult -> Bool #
Data TestResult # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TestResult -> c TestResult # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TestResult # toConstr :: TestResult -> Constr # dataTypeOf :: TestResult -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c TestResult) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TestResult) # gmapT :: (forall b. Data b => b -> b) -> TestResult -> TestResult # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TestResult -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TestResult -> r # gmapQ :: (forall d. Data d => d -> u) -> TestResult -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> TestResult -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TestResult -> m TestResult # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TestResult -> m TestResult # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TestResult -> m TestResult #
Ord TestResult # |
Methods compare :: TestResult -> TestResult -> Ordering # (<) :: TestResult -> TestResult -> Bool # (<=) :: TestResult -> TestResult -> Bool # (>) :: TestResult -> TestResult -> Bool # (>=) :: TestResult -> TestResult -> Bool # max :: TestResult -> TestResult -> TestResult # min :: TestResult -> TestResult -> TestResult #
Show TestResult # |
Methods showsPrec :: Int -> TestResult -> ShowS # show :: TestResult -> String # showList :: [TestResult] -> ShowS #
Generic TestResult # |
Associated Types type Rep TestResult :: * -> * # Methods from :: TestResult -> Rep TestResult x # to :: Rep TestResult x -> TestResult #
FromJSON TestResult # |
Methods parseJSON :: Value -> Parser TestResult # parseJSONList :: Value -> Parser [TestResult] #
ToJSON TestResult # |
Methods toJSON :: TestResult -> Value # toEncoding :: TestResult -> Encoding # toJSONList :: [TestResult] -> Value # toEncodingList :: [TestResult] -> Encoding #
type Rep TestResult # |
type Rep TestResult = D1 (MetaData "TestResult" "Statistics.Test.Types" "statistics-0.13.3.0-A6M5lvDj6Zg1bzI7OU7tSj" False) ((:+:) (C1 (MetaCons "Significant" PrefixI False) U1) (C1 (MetaCons "NotSignificant" PrefixI False) U1))