I'm writing a statistical tool in Java. Here I'm calculation pearson correlation values (r). My next step is to validate if my correlation values are good enough to prove that my to variables are correlated. So I have two approaches in mind:
a) since I have the sample size = n and the correlation = r already calculated, I could use the these values to calculate the p-value and validate if p<alpha
(level of significance)
But for this approach I'm missing the formula for calculating the p-value
b) Since I'm planning to use a fixed alpha, I was thinking of precalculating the minimum r_min for given n. (e.g n=1 -> n=10000) and then check the calculated r against the precalculated r_min.
Does anyone know about a good solution for this Problem? I already found this but here as far as I see it, the library needs to recalculates the r with would take the performance down.