The distribution of rho…

[This article was first published on Stats raving mad » R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

There was a post here about obtaining non-standard p-values for testing the correlation coefficient. The R-library


deals with this problem efficiently.



legend("topleft", col=c("black","steelblue","red","green"),lty=1,

This is how it looks like,

Now, let’s construct a table of critical values for some arbitrary or not significance levels.

xtabs(qPearson(p=q, N=23, rho = 0, lower.tail = FALSE, log.p = FALSE) ~ q )
# q
#     0.025      0.05     0.075       0.1      0.15       0.2
# 0.4130710 0.3514298 0.3099236 0.2773518 0.2258566 0.1842217

We can calculate p-values as usual too…

# [1] 0.0250003

To leave a comment for the author, please follow the link and comment on their blog: Stats raving mad » R. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)