Skip to content

Commit

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

Expand Down

0 comments on commit 1e74996

Please sign in to comment.