1
$\begingroup$

If one knows the correlation coefficient for two variables, and also the number of observations, but does not have access to the raw data, how does one calculate a p-value?

[EDIT:] Please understand that I am asking about how this is done. Not requesting the name of a software function that would do it for me, as some have assumed. An ideal answer to this question would be a procedure that one could theoretically follow, using a pen and paper if necessary, to get from a correlation coefficient and a number of observations to an accurate p-value (regardless of how long that procedure would actually take if carried out with pen-and-paper). [EDIT ENDS]

The following answer explains how to calculate the t score for a correlation, but relies on an Excel function called tdist to derive a p-value from that t score (which is unhelpful if one does not happen to be using Excel):

https://stats.stackexchange.com/a/120235/248482

$\endgroup$
  • $\begingroup$ @whuber I don't feel that it was fair to close this question for that reason. As my edit (made five days ago) makes clear, I'm not asking about programming but about the mathematical question of how to calculate a p-value from a correlation coefficient given the number of observations. The only question on this site that addresses that problem (a) confusingly phrases it in relation to specific data and (b) has only a single answer, which does not answer the general mathematical question because it makes sense only if one is using a specific software package, i.e. Microsoft Excel. $\endgroup$ – Westcroft_to_Apse Jun 13 '19 at 11:39
  • $\begingroup$ No problem: just edit your question to make the intentions clear and the community can vote to re-open it. $\endgroup$ – whuber Jun 13 '19 at 12:30
  • 1
    $\begingroup$ Your edits bumped this thread into the reopen queue, but it was voted to be left closed. The required formulas are in the linked thread. You won't be able to calculate the t-distribution with pencil and paper, but it can be calculated by basic functions in a wide range of software (even Excel). You could also look up values in a t-table in the back of any stats textbook. $\endgroup$ – gung - Reinstate Monica Jun 13 '19 at 20:33
  • 1
    $\begingroup$ I'm unsure, because you still haven't disclosed the nature of the answer you seek: do you want the name of a software function? A mathematical formula? A numerical algorithm? At this point you have links to all three kinds of answers and I'm at a loss to know what else you might have in mind. You seem interested only in debating the status of your question rather than revealing your intentions. I have done what I can to help and am sorry it was unsuccessful. $\endgroup$ – whuber Jun 13 '19 at 21:45
  • 1
    $\begingroup$ The whole of that answer is in one place: the thread where you began (as kindly pointed out earlier by @gung). I haven't objected to anything, by the way: I have only been asking you to formulate an answerable question. If you continue only to comment and not to attempt that, it will be difficult not to conclude that you're just trolling us and aren't really interested in asking or getting answers to any substantial question. That's why I'm bowing out of this dialog. $\endgroup$ – whuber Jun 13 '19 at 22:16
2
$\begingroup$

In R, tdist() fonction is pt(q,df).

$\endgroup$
  • 1
    $\begingroup$ Thank you for this useful information. It doesn't answer the question as asked, though. $\endgroup$ – Westcroft_to_Apse Jun 7 '19 at 16:46
  • 1
    $\begingroup$ That's not quite correct, because Excel has a strange (two-tailed) implementation of the Student t CDF. pt is closer to the T.DIST function in new versions of Excel. $\endgroup$ – whuber Jun 7 '19 at 16:47
  • $\begingroup$ $1-T.DIST(x,n)$ give the same value as $2*pt(x,n)-1$ $\endgroup$ – Abdoul Haki Jun 7 '19 at 18:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.