Computational Provenance & Reproducibility Record

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

Computational Provenance & Reproducibility Record Regression Analysis · 1.0.0 · DOI 10.5281/zenodo.21318613

Computational Provenance & Reproducibility Record

RAISINS · Regression Analysis Module

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

1 Module Metadata

Parameter Specification
Module Regression Analysis
Module Version 1.0.0
DOI 10.5281/zenodo.21318613
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
MASS 7.3-65 CRAN stepAIC()
car 3.1-5 CRAN vif(), ncvTest()
lmtest 0.9-40 CRAN dwtest()
effectsize 1.0.1 CRAN standardize_parameters()
stats 4.5.2 Base R lm(), summary(), confint(), anova(), predict(), AIC(), BIC(), hatvalues(), cooks.distance(), rstudent(), shapiro.test()

3 Statistical Function Registry

Analytical Role Primary Function(s)
Model fitting stats::lm()
Variable selection MASS::stepAIC()
Coefficient inference base::summary(), stats::confint(), effectsize::standardize_parameters()
Regression ANOVA & fit stats::anova(), stats::AIC(), stats::BIC()
Multicollinearity car::vif()
Heteroscedasticity car::ncvTest()
Residual normality stats::shapiro.test()
Autocorrelation lmtest::dwtest()
Influence diagnostics stats::hatvalues(), stats::cooks.distance(), stats::rstudent(), stats::dffits()
Prediction stats::predict()

4 Default Methods & Parameters

Analysis Step / Parameter Default Method / Value
Model Fitting Method Ordinary least squares multiple linear regression via lm()
Variable Selection Stepwise (optional) AIC-based MASS::stepAIC(); direction both (default), forward, or backward; initial and final AIC are reported
Coefficient
Inference
Estimates Estimate, standard error, t value, and p-value from summary()
Significance Star codes assigned with symnum() at cut points 0.001 / 0.01 / 0.05
Intervals & standardised 95% confidence intervals via confint(); standardised coefficients via effectsize::standardize_parameters(method = "refit")
Model Fit ANOVA Sequential (Type I) decomposition via anova()
Metrics R², adjusted R², residual standard error, F-statistic and p-value, AIC, BIC, RMSE, MAE, and PRESS
Regression
Assumptions
Multicollinearity car::vif() (VIF; GVIF for categorical predictors); low < 5, moderate 5–10, high > 10; computed only when the model has more than two coefficients
Heteroscedasticity car::ncvTest() non-constant error variance score test
Residual normality Shapiro-Wilk on residuals (shapiro.test()); valid for 3 ≤ n ≤ 5000
Autocorrelation Durbin-Watson test (lmtest::dwtest())
Influence
Diagnostics
Measures & thresholds Leverage (hatvalues(), flag > 2p/n), Cook's distance (flag > 4/n), standardised and studentised residuals (|studentised| > 2 potential, > 3 extreme), and DFFITS
Prediction Intervals predict() with 95% confidence and prediction intervals

5 R Code for Key Analytical Steps

The code blocks below demonstrate the exact computation behind each reported result using the mtcars dataset from the datasets package.

5.1 Model Fitting and Variable Selection

data(mtcars)
model_full <- lm(mpg ~ wt + hp + disp, data = mtcars)

# optional AIC-based stepwise selection
# direction: "both" (default), "forward", or "backward"
model <- MASS::stepAIC(model_full, direction = "both", trace = FALSE)
AIC(model_full); AIC(model)

5.2 Coefficients, Intervals and Regression ANOVA

summary(model)$coefficients          # estimate, std. error, t value, p-value
confint(model, level = 0.95)         # 95% confidence intervals
effectsize::standardize_parameters(model, method = "refit")  # standardised betas
anova(model)                         # sequential (Type I) ANOVA

5.3 Model Fit Metrics

sm  <- summary(model)
res <- residuals(model)
sm$r.squared; sm$adj.r.squared; sm$sigma   # R2, adjusted R2, residual std. error
sqrt(mean(res^2))                          # RMSE
mean(abs(res))                             # MAE
AIC(model); BIC(model)

5.4 Regression Assumption Tests

car::vif(model)                 # multicollinearity (VIF / GVIF)
car::ncvTest(model)             # non-constant error variance (heteroscedasticity)
shapiro.test(residuals(model))  # normality of residuals (3 <= n <= 5000)
lmtest::dwtest(model)           # autocorrelation (Durbin-Watson)

5.5 Influence and Outlier Diagnostics

n <- nobs(model); p <- length(coef(model))
hatvalues(model)        # leverage        (flag > 2p/n)
cooks.distance(model)   # Cook's distance (flag > 4/n)
rstandard(model)        # standardised residuals
rstudent(model)         # studentised residuals (|.| > 3 extreme)
dffits(model)           # DFFITS

5.6 Prediction

newdata <- data.frame(wt = 3.0, hp = 120, disp = 160)
predict(model, newdata, interval = "confidence", level = 0.95)
predict(model, newdata, interval = "prediction", level = 0.95)

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

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/

Venables, W. N., & Ripley, B. D. (2002). Modern Applied Statistics with S (4th ed.). Springer. https://www.stats.ox.ac.uk/pub/MASS4/

Fox, J., & Weisberg, S. (2019). An R Companion to Applied Regression (3rd ed.). Sage. https://socialsciences.mcmaster.ca/jfox/Books/Companion/

Zeileis, A., & Hothorn, T. (2002). Diagnostic Checking in Regression Relationships. R News, 2(3), 7-10. https://CRAN.R-project.org/doc/Rnews/

Ben-Shachar, M. S., Lüdecke, D., & Makowski, D. (2020). effectsize: Estimation of Effect Size Indices and Standardized Parameters. Journal of Open Source Software, 5(56), 2815. https://doi.org/10.21105/joss.02815

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