Skip to content

Commit 1e74996

Browse files
fix: accurate Student t-distribution table (#90)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
1 parent 6ae694f commit 1e74996

File tree

1 file changed

+123
-120
lines changed

1 file changed

+123
-120
lines changed

src/constants.ts

+123-120
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,127 @@
1+
/**
2+
* Student t-distribution two-tailed critical values for 95% confidence level.
3+
*/
14
const tTable: Record<string, number> = {
2-
1: 12.71,
3-
2: 4.303,
4-
3: 3.182,
5-
4: 2.776,
6-
5: 2.571,
7-
6: 2.447,
8-
7: 2.365,
9-
8: 2.306,
10-
9: 2.262,
11-
10: 2.228,
12-
11: 2.201,
13-
12: 2.179,
14-
13: 2.16,
15-
14: 2.145,
16-
15: 2.131,
17-
16: 2.12,
18-
17: 2.11,
19-
18: 2.101,
20-
19: 2.093,
21-
20: 2.086,
22-
21: 2.08,
23-
22: 2.074,
24-
23: 2.069,
25-
24: 2.064,
26-
25: 2.06,
27-
26: 2.056,
28-
27: 2.052,
29-
28: 2.048,
30-
29: 2.045,
31-
30: 2.042,
32-
31: 2.0399,
33-
32: 2.0378,
34-
33: 2.0357,
35-
34: 2.0336,
36-
35: 2.0315,
37-
36: 2.0294,
38-
37: 2.0273,
39-
38: 2.0252,
40-
39: 2.0231,
41-
40: 2.021,
42-
41: 2.0198,
43-
42: 2.0186,
44-
43: 2.0174,
45-
44: 2.0162,
46-
45: 2.015,
47-
46: 2.0138,
48-
47: 2.0126,
49-
48: 2.0114,
50-
49: 2.0102,
51-
50: 2.009,
52-
51: 2.0081,
53-
52: 2.0072,
54-
53: 2.0063,
55-
54: 2.0054,
56-
55: 2.0045,
57-
56: 2.0036,
58-
57: 2.0027,
59-
58: 2.0018,
60-
59: 2.0009,
61-
60: 2,
62-
61: 1.9995,
63-
62: 1.999,
64-
63: 1.9985,
65-
64: 1.998,
66-
65: 1.9975,
67-
66: 1.997,
68-
67: 1.9965,
69-
68: 1.996,
70-
69: 1.9955,
71-
70: 1.995,
72-
71: 1.9945,
73-
72: 1.994,
74-
73: 1.9935,
75-
74: 1.993,
76-
75: 1.9925,
77-
76: 1.992,
78-
77: 1.9915,
79-
78: 1.991,
80-
79: 1.9905,
81-
80: 1.99,
82-
81: 1.9897,
83-
82: 1.9894,
84-
83: 1.9891,
85-
84: 1.9888,
86-
85: 1.9885,
87-
86: 1.9882,
88-
87: 1.9879,
89-
88: 1.9876,
90-
89: 1.9873,
91-
90: 1.987,
92-
91: 1.9867,
93-
92: 1.9864,
94-
93: 1.9861,
95-
94: 1.9858,
96-
95: 1.9855,
97-
96: 1.9852,
98-
97: 1.9849,
99-
98: 1.9846,
100-
99: 1.9843,
101-
100: 1.984,
102-
101: 1.9838,
103-
102: 1.9836,
104-
103: 1.9834,
105-
104: 1.9832,
106-
105: 1.983,
107-
106: 1.9828,
108-
107: 1.9826,
109-
108: 1.9824,
110-
109: 1.9822,
111-
110: 1.982,
112-
111: 1.9818,
113-
112: 1.9816,
114-
113: 1.9814,
115-
114: 1.9812,
116-
115: 1.9819,
117-
116: 1.9808,
118-
117: 1.9806,
119-
118: 1.9804,
120-
119: 1.9802,
121-
120: 1.98,
5+
1: 12.706204736432102,
6+
2: 4.3026527299112765,
7+
3: 3.182446305284264,
8+
4: 2.7764451051977996,
9+
5: 2.57058183661474,
10+
6: 2.446911848791681,
11+
7: 2.3646242510102997,
12+
8: 2.306004135033371,
13+
9: 2.262157162740992,
14+
10: 2.2281388519649385,
15+
11: 2.200985160082949,
16+
12: 2.178812829663418,
17+
13: 2.160368656461013,
18+
14: 2.1447866879169277,
19+
15: 2.131449545559323,
20+
16: 2.1199052992210112,
21+
17: 2.109815577833181,
22+
18: 2.10092204024096,
23+
19: 2.0930240544082634,
24+
20: 2.085963447265837,
25+
21: 2.0796138447276626,
26+
22: 2.073873067904015,
27+
23: 2.068657610419041,
28+
24: 2.063898561628021,
29+
25: 2.0595385527532946,
30+
26: 2.0555294386428713,
31+
27: 2.0518305164802837,
32+
28: 2.048407141795244,
33+
29: 2.0452296421327034,
34+
30: 2.042272456301238,
35+
31: 2.0395134463964077,
36+
32: 2.0369333434601016,
37+
33: 2.0345152974493383,
38+
34: 2.0322445093177186,
39+
35: 2.030107928250343,
40+
36: 2.0280940009804507,
41+
37: 2.0261924630291097,
42+
38: 2.0243941645751367,
43+
39: 2.0226909117347285,
44+
40: 2.021075382995338,
45+
41: 2.019540963982894,
46+
42: 2.0180816970958815,
47+
43: 2.0166921941428138,
48+
44: 2.0153675699129416,
49+
45: 2.0141033848332928,
50+
46: 2.012895595294589,
51+
47: 2.011740510475755,
52+
48: 2.010634754696446,
53+
49: 2.0095752344892093,
54+
50: 2.0085591097152062,
55+
51: 2.0075837681558824,
56+
52: 2.0066468031022118,
57+
53: 2.00574599353695,
58+
54: 2.0048792865665233,
59+
55: 2.0040447818101814,
60+
56: 2.003240717496698,
61+
57: 2.002465458054599,
62+
58: 2.0017174830120927,
63+
59: 2.0009953770482105,
64+
60: 2.000297821058262,
65+
61: 1.9996235841149783,
66+
62: 1.9989715162223116,
67+
63: 1.998340541772196,
68+
64: 1.9977296536259739,
69+
65: 1.9971379077520126,
70+
66: 1.9965644183594748,
71+
67: 1.996008353475506,
72+
68: 1.9954689309194023,
73+
69: 1.994945414632814,
74+
70: 1.9944371113297732,
75+
71: 1.9939433674345044,
76+
72: 1.9934635662785831,
77+
73: 1.9929971255321668,
78+
74: 1.9925434948468204,
79+
75: 1.9921021536898658,
80+
76: 1.9916726093523491,
81+
77: 1.9912543951146042,
82+
78: 1.9908470685550523,
83+
79: 1.9904502099893606,
84+
80: 1.9900634210283845,
85+
81: 1.9896863232444832,
86+
82: 1.989318556936819,
87+
83: 1.9889597799871794,
88+
84: 1.9886096667986737,
89+
85: 1.988267907310378,
90+
86: 1.9879342060816723,
91+
87: 1.9876082814405773,
92+
88: 1.987289864690939,
93+
89: 1.9869786993737681,
94+
90: 1.9866745405784685,
95+
91: 1.9863771543000652,
96+
92: 1.9860863168388938,
97+
93: 1.985801814239503,
98+
94: 1.9855234417658303,
99+
95: 1.9852510034099267,
100+
96: 1.9849843114317696,
101+
97: 1.9847231859278835,
102+
98: 1.9844674544266925,
103+
99: 1.9842169515086832,
104+
100: 1.983971518449634,
105+
101: 1.9837310028852815,
106+
102: 1.9834952584959407,
107+
103: 1.9832641447097104,
108+
104: 1.9830375264229902,
109+
105: 1.9828152737371547,
110+
106: 1.9825972617102912,
111+
107: 1.9823833701230178,
112+
108: 1.9821734832574516,
113+
109: 1.9819674896884745,
114+
110: 1.9817652820865104,
115+
111: 1.981566757031071,
116+
112: 1.9813718148344008,
117+
113: 1.9811803593745805,
118+
114: 1.9809922979375068,
119+
115: 1.9808075410672004,
120+
116: 1.980626002423938,
121+
117: 1.9804475986497296,
122+
118: 1.9802722492407063,
123+
119: 1.9800998764260065,
124+
120: 1.979930405052777,
122125
infinity: 1.96,
123126
};
124127

0 commit comments

Comments
 (0)