# source:project/wiki/eggref/4/statistics@20488

Last change on this file since 20488 was 20488, checked in by svnwiki, 10 years ago

Anonymous wiki edit for IP [86.129.203.107]:

File size: 5.1 KB
Line
1Still under testing!
2
3== Introduction
4
5This library is a port of [[http://compbio.uchsc.edu/Hunter_lab/Hunter/|Larry Hunter]]'s Lisp statistics library to chicken scheme.
6
7The library provides a number of formulae and methods taken from the book "Fundamentals of Biostatistics" by Bernard Rosner (5th edition).
8
9== Provided Functions
10
11=== Utilities
12
13*    average-rank
14*   beta-incomplete
15*    bin-and-count
16*   combinations
17*    factorial
18*    find-critical-value
19*    fisher-z-transform
20*    gamma-incomplete
21*    gamma-ln
22*    permutations
23*    random-normal
24
25; (random-pick items) : given a list of {{items}}, returns a random item.
26; (random-sample n items) : given a number of items to select, {{n}}, and a list of items to select from, {{items}}, returns a random sample without replacement of size {{n}}.
27; (sign n) : given a number {{n}}, returns 0, 1 or -1 according to if {{n}} is zero, positive or negative.
28; (square n) : given a number {{n}}, returns the square of {{n}}.
29
30=== Descriptive statistics
31
32These functions provide information on a given list of numbers.  Note, the list of items does not have to be sorted.
33
34; (mean items) : given a list of numbers, {{items}}, returns the arithmetic mean of the items (the sum of the numbers divided by the number of numbers).
35 (mean '(1 2 3 4 5)) => 3
36; (median items) : given a list of numbers, {{items}}, returns the value which separates the upper and lower halves of the list of numbers.
37 (median '(1 2 3 4)) => 5/2
38; (mode items) :
39; (geometric-mean items) : given a list of numbers, {{items}}, returns the geometric mean of the items (the result of multiplying the items together and then taking the nth root, where n is the number of items).
40 (geometric-mean '(1 2 3 4 5)) => 2.60517108469735
41; (range items) : given a list of numbers, {{items}}, returns the difference between the biggest and the smallest value.
42 (range '(5 1 2 3 4)) => 4
43; (percentile items percent) : given a list of numbers, {{items}}, and a percentage, {{percent}}, returns the item closest to the percent value if the items are sorted into order; the returned item may be in the list, or the average of adjacent values.
44 (percentile '(1 2 3 4) 50) => 5/2
45 (percentile '(1 2 3 4) 67) => 3
46; (variance items) : given a list of numbers, {{items}}, returns the variance of the numbers.
47; (standard-deviation items) : given a list of numbers, {{items}}, returns the standard deviation of the numbers.
48; (coefficient-of-variation items) : given a list of numbers, {{items}}, returns 100 * (std-dev / mean) of the items.
49 (coefficient-of-variation '(1 2 3 4)) => 51.6397779494322
50; (standard-error-of-the-mean items) : given a list of numbers, {{items}}, returns std-dev / sqrt(length items).
51  (standard-error-of-the-mean '(1 2 3 4)) => 0.645497224367903
52; (mean-sd-n items) : given a list of numbers, {{items}}, returns three '''values''', one for the mean, one for the standard deviation, and one for the length of the list.
53 > (mean-sd-n '(1 2 3 4))
54 5/2
55 1.29099444873581
56 4
57
58=== Distributional functions
59
60*    binomial-probability
61*    binomial-cumulative-probability
62*    binomial-ge-probability
63*    binomial-le-probability
64*    poisson-probability
65*    poisson-cumulative-probability
66*    poisson-ge-probability
67*    normal-pdf
68*    convert-to-standard-normal
69*    phi
70*    z
71*    t-distribution
72*    chi-square
73*    chi-square-cdf
74
75===  Confidence intervals
76
77*    binomial-probability-ci
78*    poisson-mu-ci
79*    normal-mean-ci
80*    normal-mean-ci-on-sequence
81*    normal-variance-ci
82*    normal-variance-ci-on-sequence
83*    normal-sd-ci
84*    normal-sd-ci-on-sequence
85
86=== Hypothesis testing
87
88====  (parametric)
89
90*    z-test
91*    z-test-on-sequence
92*    t-test-one-sample
93*    t-test-one-sample-on-sequence
94*    t-test-paired
95*    t-test-paired-on-sequences
96*    t-test-two-sample
97*    t-test-two-sample-on-sequences
98*    f-test
99*    chi-square-test-one-sample
100*    binomial-test-one-sample
101*    binomial-test-two-sample
102*    fisher-exact-test
103*    mcnemars-test
104*    poisson-test-one-sample
105
106==== (non parametric)
107
108*    sign-test
109*    sign-test-on-sequence
110*    wilcoxon-signed-rank-test
111*    wilcoxon-signed-rank-test-on-sequences
112*    chi-square-test-rxc
113*    chi-square-test-for-trend
114
115=== Sample size estimates
116
117*    t-test-one-sample-sse
118*    t-test-two-sample-sse
119*    t-test-paired-sse
120*    binomial-test-one-sample-sse
121*    binomial-test-two-sample-sse
122*    binomial-test-paired-sse
123*    correlation-sse
124
125=== Correlation and regression
126
127*    linear-regression
128*    correlation-coefficient
129*    correlation-test-two-sample
130*    correlation-test-two-sample-on-sequences
131*    spearman-rank-correlation
132
133=== Significance test functions
134
135*    t-significance
136*    f-significance
137
138
139== Authors
140
141[[http://wiki.call-cc.org/users/peter-lane|Peter Lane]] wrote the scheme version of this library.  The original Lisp version was written by [[http://compbio.uhsc.edu/Hunter_lab/Hunter/|Larry Hunter]].
142