data(mtcars)
corr_method <- "pearson" # or "spearman", "kendall"
corr_mat <- cor(mtcars,
method = corr_method,
use = "pairwise.complete.obs")
round(corr_mat, 2)Computational Provenance & Reproducibility Record Correlation Analysis · 1.0.0 · DOI 10.5281/zenodo.21321191
This Computational Provenance Record documents the statistical computing environment, software dependencies, computational provenance, and bibliographic references associated with the RAISINS Correlation Analysis module. It is intended to support computational reproducibility and software transparency. Detailed statistical methodology, mathematical derivations, and user guidance are provided separately in the official module documentation.
Any issues or updates required please comment here
Go to the App from here| Parameter | Specification |
|---|---|
| Module | Correlation Analysis |
| Module Version | 1.0.0 |
| DOI | 10.5281/zenodo.21321191 |
| Document Type | Computational workflow |
| Statistical Engine | R |
| R Version | 4.5.2 |
| Reproducibility | Execution Environment: Posit Connect · GCR · renv-locked |
| Package | Version | Repository | Core Statistical Functions |
|---|---|---|---|
| Hmisc | 5.2-5 |
CRAN | rcorr() |
| stats | 4.5.2 |
Base R | cor() |
| Analytical Role | Primary Function(s) |
|---|---|
| Correlation coefficients | stats::cor() |
| Correlation significance | Hmisc::rcorr() |
| Analysis | Step / Parameter | Default Method / Value |
|---|---|---|
| Correlation Analysis |
Coefficient | cor() with method = "pearson" (default), or "spearman" / "kendall"; missing values handled by use = "pairwise.complete.obs" |
| Significance | P-value matrix from Hmisc::rcorr() for Pearson and Spearman; Kendall p-values are not produced in the matrix view and are shown as NA; decision threshold α (default 0.05) |
|
| Star codes | *** p ≤ 0.001, ** p ≤ 0.01, * p ≤ 0.05 |
The code blocks below demonstrate the exact computation behind each reported result using the mtcars dataset from the datasets package. All blocks are illustrative and non-executing (eval = FALSE).
data(mtcars)
corr_method <- "pearson" # or "spearman", "kendall"
corr_mat <- cor(mtcars,
method = corr_method,
use = "pairwise.complete.obs")
round(corr_mat, 2)# P-value matrix for Pearson and Spearman via Hmisc::rcorr()
rc <- Hmisc::rcorr(as.matrix(mtcars), type = "pearson") # or "spearman"
rc$r # correlation coefficients
rc$P # p-value matrix (NA on the diagonal)
# star codes applied at alpha cut points; overall alpha defaults to 0.05
# Kendall does not return a p-value matrix here, so those cells are set to NA
alpha <- 0.05
stars <- ifelse(rc$P <= 0.001, "***",
ifelse(rc$P <= 0.01, "**",
ifelse(rc$P <= 0.05, "*", "")))
starsExplore the entire Correlation Analysis module in preview mode using our demo datasets. To submit suggestions or report a workflow issue, please use the discussion section below, or visit the official RAISINS website.
RAISINS uses R for all its statistical computations. Every package used to generate major results is listed and demonstrated with examples, so results can be reproduced independently. These results are then organized and formatted on the RAISINS website along with visualisation to make them easier to use and interpret. RAISINS also has its own custom-built statistical tools for managing workflows, validating results, and generating reports. Details of these are not fully covered here, they’re shared with outside researchers only on request, and are subject to licensing terms.
R Core Team. (2025). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/
Harrell, F. E. (2025). Hmisc: Harrell Miscellaneous (R package version 5.2-5). https://doi.org/10.32614/CRAN.package.Hmisc
Allaire, J. J., Xie, Y., Dervieux, C., McPherson, J., Luraschi, J., Ushey, K., Atkins, A., Wickham, H., Cheng, J., Chang, W., & Iannone, R. (2026). rmarkdown: Dynamic Documents for R (R package version 2.31). https://github.com/rstudio/rmarkdown