Ticket #837: scrutiny-fixes.patch

File scrutiny-fixes.patch, 1.4 KB (added by sjamaan, 12 years ago)
  • statistics.scm

     
    564564      (let loop ((i 0))
    565565        (if (= i (+ 1 k))
    566566          sum-up-to-k
    567           (set! sum-up-to-k (+ sum-up-to-k (binomial-probability n i p)))))))
     567          (begin (set! sum-up-to-k (+ sum-up-to-k (binomial-probability n i p)))
     568                 sum-up-to-k)))))
    568569
    569570  ;; POISSON-PROBABILITY
    570571  ;; Rosner 100
     
    11271128                            (if (= i number-tied)
    11281129                              (reverse result)
    11291130                              (loop (+ 1 i)
    1130                                     (cons (cons (list-ref (+ first i) sorted-list)
     1131                                    (cons (cons (list-ref sorted-list (+ first i))
    11311132                                                (list avg-rank))
    11321133                                          result))))))))
    11331134                  distinct-values)
     
    11481149                                 48)
    11491150                              0))
    11501151               (var-r1 (- (/ (* n (+ 1 n) (+ 1 (* 2 n))) 24) ties-factor))
    1151                (T-score (/ (- (abs (- r1 expected-r1)) 0.5) (sqrt (var-r1)))))
     1152               (T-score (/ (- (abs (- r1 expected-r1)) 0.5) (sqrt var-r1))))
    11521153          (* (if (eq? tails ':both) 2 1)
    11531154             (- 1 (phi T-score)))))))
    11541155