Computational Provenance & Reproducibility Record

RAISINS - R and AI Solutions for INferential Statistics · Online Statistical Analysis Platform for Agricultural Research

Computational Provenance & Reproducibility Record Descriptive Statistics · 1.0.0 · DOI 10.5281/zenodo.21317018

Computational Provenance & Reproducibility Record

RAISINS · Descriptive Statistics Module

This Computational Provenance Record documents the statistical computing environment, software dependencies, computational provenance, and bibliographic references associated with the RAISINS Descriptive Statistics 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.

1 Module Metadata

Parameter Specification
Module Descriptive Statistics
Module Version Descriptive 1.0.0
DOI 10.5281/zenodo.21317018
Document Type Computational workflow
Statistical Engine R
R Version 4.5.2
Reproducibility Execution Environment: Posit Connect · GCR · renv-locked

2 Statistical Dependency Manifest

Package Version Repository Core Statistical Functions
moments 0.14.1 CRAN skewness(), kurtosis()
nortest 1.0-4 CRAN ad.test()
stats 4.5.2 Base R mean(), median(), sd(), var(), quantile(), IQR(), range(), cor(), shapiro.test(), chisq.test(), table(), prop.table(), cut()

3 Statistical Function Registry

Analytical Role Primary Function(s)
Central tendency base::mean(), stats::median()
Dispersion stats::sd(), stats::var(), stats::quantile(), stats::IQR(), base::range()
Distribution shape moments::skewness(), moments::kurtosis()
Normality testing stats::shapiro.test(), nortest::ad.test()
Correlation stats::cor()
Categorical association stats::chisq.test()
Cross-tabulation base::table(), base::prop.table(), base::cut()

4 Default Methods & Parameters

Analysis Step / Parameter Default Method / Value
Descriptive
Statistics
Central tendency & dispersion Mean, median, standard deviation, variance, minimum, maximum, range, first and third quartiles (Q1, Q3), and IQR, all computed with na.rm = TRUE
Distribution shape Skewness and kurtosis via moments::skewness() and moments::kurtosis(). The moments convention returns population (biased) skewness and non-excess kurtosis, for which a normal distribution has kurtosis ≈ 3
Grouping Group-wise summaries when a grouping variable is selected (dplyr::group_by()); pooled summary otherwise
Normality Test Default test Shapiro-Wilk (shapiro.test()); valid for 3 ≤ N ≤ 5000
Alternative test Anderson-Darling (nortest::ad.test()); valid for N > 7
Decision rule p < 0.05 is reported as a departure from normality
Correlation
(cor())
Method Pearson (default); Spearman and Kendall optional
Missing data use = "pairwise.complete.obs"
Chi-square Test
of Independence

(chisq.test())
Test Pearson chi-square; Yates continuity correction is applied automatically for 2×2 tables
Second variable handling Categorical variable used as-is; integer-like variable with ≤ 7 unique levels treated as a factor; continuous variable discretised to Low / Medium / High using cut points at mean ± 1 SD
Cross-tab percentages Row and column percentages via prop.table()

5 R Code for Key Analytical Steps

The code blocks below demonstrate the exact computation behind each reported result using the iris dataset from the datasets package. All blocks are illustrative and non-executing (eval = FALSE).

5.1 Descriptive Summary Statistics

library(dplyr)
library(tidyr)
data(iris)
# numeric variables only
num <- iris |> dplyr::select(where(is.numeric))
# per-variable summary (pooled)
num |>
  summarise(across(everything(), list(
    N        = ~sum(!is.na(.)),
    Mean     = ~mean(., na.rm = TRUE),
    Median   = ~median(., na.rm = TRUE),
    SD       = ~sd(., na.rm = TRUE),
    Variance = ~var(., na.rm = TRUE),
    Min      = ~min(., na.rm = TRUE),
    Max      = ~max(., na.rm = TRUE),
    Range    = ~diff(range(., na.rm = TRUE)),
    Q1       = ~quantile(., 0.25, na.rm = TRUE),
    Q3       = ~quantile(., 0.75, na.rm = TRUE),
    IQR      = ~IQR(., na.rm = TRUE),
    Skewness = ~moments::skewness(., na.rm = TRUE),
    Kurtosis = ~moments::kurtosis(., na.rm = TRUE)
  ), .names = "{.col}__{.fn}")) |>
  pivot_longer(everything(),
               names_to  = c("Variable", "Statistic"),
               names_sep = "__",
               values_to = "Value") |>
  pivot_wider(names_from = Statistic, values_from = Value)

# group-wise summary (e.g., by Species) uses the same block with:
# iris |> group_by(Species) |> group_modify(~ summarise_stats(.x))

5.2 Normality Testing

library(nortest)
data(iris)
num <- iris[sapply(iris, is.numeric)]
# Shapiro-Wilk (3 <= N <= 5000)
lapply(num, shapiro.test)
# Anderson-Darling (N > 7)
lapply(num, nortest::ad.test)

5.3 Correlation Matrix

data(iris)
num <- iris[sapply(iris, is.numeric)]
cor(num,
    use    = "pairwise.complete.obs",
    method = "pearson")   # or "spearman", "kendall"

5.4 Chi-square Test of Independence

data(iris)
# first variable categorical (Species); second variable continuous ->
# discretised to Low / Medium / High at mean +/- 1 SD
classify_num <- function(z) {
  m <- mean(z, na.rm = TRUE)
  s <- sd(z, na.rm = TRUE)
  cut(z,
      breaks = c(-Inf, m - s, m + s, Inf),
      labels = c("Low", "Medium", "High"),
      right  = TRUE)
}
tbl <- table(iris$Species, classify_num(iris$Sepal.Length))
prop.table(tbl, 1) * 100   # row percentages
prop.table(tbl, 2) * 100   # column percentages
chisq.test(tbl)

Explore the entire Descriptive Statistics 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.

6 RAISINS Native Statistical Framework

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.

7 Package References

R Core Team. (2025). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/

Komsta, L., & Novomestky, F. (2022). moments: Moments, Cumulants, Skewness, Kurtosis and Related Tests (R package version 0.14.1). https://doi.org/10.32614/CRAN.package.moments

Gross, J., & Ligges, U. (2015). nortest: Tests for Normality (R package version 1.0-4). https://doi.org/10.32614/CRAN.package.nortest

Wickham, H., François, R., Henry, L., Müller, K., & Vaughan, D. (2023). dplyr: A Grammar of Data Manipulation (R package version 1.1.4). https://doi.org/10.32614/CRAN.package.dplyr

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

Feedback & Discussion