anchor.diff:  
   Anova.oneWayAnova dmg
   
  -
  -//TukeyHSD contrastMatrixDmg dmg 
  -// https://brownmath.com/stat/anova1.htm
  -
  -let dsd = 
  -    [|
  -     //[|7.;4.;6.;8.;6.;6.;2.;9.|];
  -     //[|5.;5.;3.;4.;4.;7.;2.;2.|];
  -     //[|2.;4.;7.;1.;2.;1.;5.;5.|] ; 
  -        [|64.; 72.; 68.; 77.; 56.; 95.;|] ;
  -        [|78.; 91.; 97.; 82.; 85.; 77.;|] ;
  -        [|75.; 93.; 78.; 71.; 63.; 76.;|] ;
  -        [|55.; 66.; 49.; 64.; 70.; 68.;|] ;   
  -    |]
  -
  -let contrastMatrixDsd = contrastMatrix //used in docs for "Anova"
  -
  -Anova.oneWayAnova dsd
  -
  -tukeyHSD contrastMatrixDsd dsd 
  -
  +(**
  +###Tukey HSD 
  +
  +Tukeys honestly significant difference (HSD) can be used to inspect a significant ANOVA result for underlying causes.
  +Using this post hoc test you can determine which of the means differ significantly from each other.
  +
  +Task: It should be tested if one or more means of samples taken from different mutants differ from each other.
  +
  +*)
  +
  +
  +// Example values from: https://brownmath.com/stat/anova1.htm
  +let hsdExample = 
  +    [|
  +        [|64.; 72.; 68.; 77.; 56.; 95.;|] // sample of mutant/drug/factor 1 
  +        [|78.; 91.; 97.; 82.; 85.; 77.;|] // sample of mutant/drug/factor 2 
  +        [|75.; 93.; 78.; 71.; 63.; 76.;|] // sample of mutant/drug/factor 3 
  +        [|55.; 66.; 49.; 64.; 70.; 68.;|] // sample of mutant/drug/factor 4    
  +    |]
  +
  +
  +let anovaResult = Anova.oneWayAnova hsdExample
  +
  +(*
  +    anovaResult.Factor.Statistic = 5.41
  +    The factor statistic indicates how much more variability there is between the the samples 
  +    than within the samples.
  +    anovaResult.Factor.PValue = 0.0069
  +    A significant p value in the factor field indicates that one or more means differ from each other
  +*)
  +
  +(**
  +If and only if the ANOVA p value is below the alpha level (e.g. 0.05) you can go for further analysis with post hoc tests.
  +For tukey HSD calculations you need a contrast matrix, that defines the groups you want to compare for 
  +more detailed information.
  +
  +Every contrast has as many entries as you have groups (samples). The groups, that should be compared are labeled with -0.5 or 0.5 respectively.
  +
  +*)
  +
  +// In this contrast matrix every possible scenario is covered.
  +let contrastMatrixHSD = 
  +    [| 
  +    [|1.;-1.; 0.; 0.;|] // sample 1 is compared to sample 2
  +    [|1.; 0.;-1.; 0.;|] // sample 1 is compared to sample 3
  +    [|1.; 0.; 0.;-1.;|] 
  +    [|0.; 1.;-1.; 0.;|]
  +    [|0.; 1.; 0.;-1.;|]
  +    [|0.; 0.; 1.;-1.;|] // sample 3 is compared to sample 4
  +    |]
  +
  +let hsdResult = tukeyHSD contrastMatrixHSD hsdExample 
  +
  +(*
  +    For every generated contrast array an output p value is calculated.
  +    e.g.
  +    hsdResult.[0].Significance = 0.0364
  +    hsdResult.[1].Significance = 0.4983 
  +    hsdResult.[2].Significance = 0.1001
  +    hsdResult.[3].Significance = 0.1364
  +    hsdResult.[4].Significance = 0.0008
  +    hsdResult.[5].Significance = 0.0255
  +*)
  +
  +(**
  +###Fisher Hotelling
  +
  +*)
   
   let d1 = [159.;179.;100.;45.;384.;230.;100.;320.;80.;220.;320.;210.;]
   let d2 = [14.4;15.2;11.3;2.5;22.7;14.9;1.41;15.81;4.19;15.39;17.25;9.52; ]
       
  -
   Testing.FisherHotelling.test d1 d2
  -
  -//Testing.Hays contrastMatrix 
   
   (**
   <a name="PvalueAdjust"></a>
  
positive.code: (**
  <a name="TTest"></a>
  ##T-Test
  Standard example for using the two sample T-Test.
  *)
  
  
  
  let sample1 = [|-0.2268419965; -0.3772357485|] |> FSharp.Stats.Vector.ofArray
  let sample2 = [|-0.6076633409; -0.1781469665|] |> FSharp.Stats.Vector.ofArray
  
  Testing.TTest.twoSample false sample1 sample2
  
  (**
  Link to example can be found [here](http://www.statstutor.ac.uk/resources/uploaded/paired-t-test.pdf).
  A paired t-test is used to compare two population means where you have two samples in
  which observations in one sample can be paired with observations in the other sample.
  Examples of where this might occur are:
  
negative.code:     |]
  
  let contrastMatrix = 
      [| 
      [|1.0;-1.0;0.0;0.0;|]
      [|1.0;0.0;-1.0;0.0;|]
      [|1.0;0.0;0.0;-1.0;|]
      [|0.0;1.0;-1.0;0.0;|]
      [|0.0;1.0;0.0;-1.0;|]
      [|0.0;0.0;1.0;-1.0;|]
      |]
  
  