As statistics is not my domain, I have got hard time to find and understand all missing pieces. I have seen many tables with critical levels for pearson-r but I can't find any formula I can trust. What I need is to generate this kind of table but for any value I wish:
df\p 0,1 0,05 0,02 0,01 0,001
-------------------------------------------
1 0,98769 0,99692 0,99950 0,9998 0,99999
2 0,90000 0,95000 0,98000 0,9900 0,99900
3 0,8054 0,8783 0,93433 0,95873 0,99116
4 0,7293 0,8114 0,8822 0,91720 0,97406
5 0,6694 0,7545 0,8329 0,8745 0,95074
6 0,6215 0,7067 0,7887 0,8343 0,92493
7 0,5822 0,6664 0,7498 0,7977 0,8982
8 0,5494 0,6319 0,7155 0,7646 0,8721
9 0,5214 0,6021 0,6851 0,7348 0,8471
10 0,4973 0,5760 0,6581 0,7079 0,8233
11 0,4762 0,5529 0,6339 0,6835 0,8010
12 0,4575 0,5324 0,6120 0,6614 0,7800
13 0,4409 0,5139 0,5923 0,6411 0,7603
14 0,4259 0,4973 0,5742 0,6226 0,7420
15 0,4124 0,4821 0,5577 0,6055 0,7246
16 0,4000 0,4683 0,5425 0,5897 0,7084
17 0,3887 0,4555 0,5285 0,5751 0,6932
18 0,3783 0,4438 0,5155 0,5614 0,6787
19 0,3687 0,4329 0,5034 0,5487 0,6652
20 0,3598 0,4227 0,4921 0,5368 0,6524
25 0,3233 0,3809 0,4451 0,4869 0,5974
30 0,2960 0,3494 0,4093 0,4487 0,5541
35 0,2746 0,3246 0,3810 0,4182 0,5189
40 0,2573 0,3044 0,3578 0,3932 0,4896
45 0,2428 0,2875 0,3384 0,3721 0,4648
50 0,2306 0,2732 0,3218 0,3541 0,4433
60 0,2108 0,2500 0,2948 0,3248 0,4078
70 0,1954 0,2319 0,2737 0,3017 0,3799
80 0,1829 0,2172 0,2565 0,2830 0,3568
90 0,1726 0,2050 0,2422 0,2673 0,3375
100 0,1638 0,1946 0,2301 0,2540 0,3211
More precisely I need piece of code (but not in R) to generate value for any N I need. For example for N = 79
, p = 0.01
, one-tailed (with steps N-2).
It would be great if someone explain how to calculate it step by step, post formula or just write piece of code (or pseudocode) easy to understand.
function criticalR(N, alpha){
return // this part I need;
}
console.log( criticalR(50, 0.02) ); // prints 0,5155