Computational Provenance & Reproducibility Record

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

Computational Provenance & Reproducibility Record Probit Dose/Time Response Analysis · 2.0.0 · DOI 10.5281/zenodo.21715087

Computational Provenance & Reproducibility Record

RAISINS · Probit Dose/Time Response Analysis Module

This Computational Provenance Record documents the statistical computing environment, software dependencies, computational provenance, and bibliographic references associated with the RAISINS Probit Dose/Time Response 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 Probit Dose/Time Response Analysis
Module Version 2.0.0
DOI 10.5281/zenodo.21715087
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 dose.p() (effective dose + delta-method SE)
stats 4.5.2 Base R glm(), summary(), predict(), fitted(), residuals(), logLik(), pchisq(), pnorm(), qnorm(), quantile()
datasets 4.5.2 Base R grouped mortality data used in the worked examples below

3 Statistical Function Registry

Analytical Role Primary Function(s)
Model fitting stats::glm(family = binomial(link = "probit"))
Coefficient inference base::summary() (estimate, SE, z value); Wald χ² = z² with p from stats::pchisq(df = 1)
Effective dose / time (LD, LC, LT) MASS::dose.p() at each requested response level
Confidence intervals Delta-method (Wald) interval on the fitted (dose) scale, estimate ± qnorm(1 − α/2)·SE, back-transformed when a log₁₀ dose is used
Model fit Null & residual deviance; likelihood-ratio χ² via stats::pchisq()
Pseudo R² Cox & Snell and Nagelkerke from the individual (Bernoulli) null log-likelihood (stats::logLik()-equivalent closed form)
Goodness of fit Pearson and deviance χ² against residual df via stats::residuals() and stats::pchisq() (valid for grouped count data)
Fitted dose-response curve stats::predict(type = "link", se.fit = TRUE) mapped through stats::pnorm() with a delta-method confidence band
Bootstrap interval Nonparametric case resampling (base::sample()) refit + MASS::dose.p(); percentile interval via stats::quantile()

4 Default Methods & Parameters

Analysis Step / Parameter Default Method / Value
Model Fitting Method Probit regression by maximum likelihood via glm() with binomial(link = "probit"); rows with missing values are removed listwise (na.omit()) before fitting. One model is fitted per selected response column
Response data types Three are auto-detected: grouped counts (number responding out of a user-supplied total per dose, fitted as cbind(responded, total − responded)); binary 0/1 (one row per subject); and proportions (0–1, no subject totals)
Dose / time scale Modelled on the raw scale, or optionally on log10. When a log transform is requested and non-positive doses are present, a constant offset (min − 1) is subtracted before the log so all values are positive; estimates are back-transformed for display
Coefficient
Inference
Estimates Intercept and dose-slope estimate, standard error and Wald z value from summary()
Wald test Wald χ² = z² on 1 df; p from pchisq(z^2, df = 1, lower.tail = FALSE)
Effective Dose
(LD / LC / LT)
Point estimate MASS::dose.p(model, p) at each requested response level p (default LD/LC/LT 50 and 90; user-editable). Labelled LD for doses, LC for concentrations, LT for exposure times
Confidence interval Delta-method (Wald) interval, symmetric on the fitted (dose) scale, estimate ± qnorm(1 − α/2)·SE with the SE from dose.p(); back-transformed to the original scale when log10 is used (yielding an asymmetric interval). Confidence level = 1 − α
Bootstrap interval Optional nonparametric bootstrap: set.seed(42), case resampling of the fitted data rows with replacement, refit, recompute the effective dose; percentile interval from quantile() at the chosen level. Bootstrap replicates user-set
Model Fit Overall test Likelihood-ratio χ² = null deviance − residual deviance, df = dfnull − dfresidual, p from pchisq(lower.tail = FALSE); null and residual −2 log-likelihood (deviance) reported alongside
Pseudo R² Cox & Snell R² = 1 − exp(−LR/N); Nagelkerke R² = R²CS / {1 − exp((2/N)·LL₀)}, where N is the number of individual (Bernoulli) trials and LL₀ is the individual-level null log-likelihood. Reported for grouped-count and binary data only; N/A for proportion data (no subject counts)
Goodness of fit Pearson χ² = ∑ (Pearson residuals)² and deviance χ² = residual deviance, each against the residual df, with p from pchisq(lower.tail = FALSE). This is a valid lack-of-fit test only for grouped count data (known total per dose); for individual binary or proportion data the statistics have no valid reference distribution and are shown for reference only
Dose-Response
Curve
Fitted curve & band Fitted probabilities from predict(type = "link") mapped through pnorm(); confidence band from the link-scale SE, pnorm(fit ± qnorm(1 − α/2)·SE). Observed proportions overlaid; LD50 reference lines optional

5 R Code for Key Analytical Steps

The code blocks below demonstrate the exact computation behind each reported result using a classic grouped dose-response dataset (Bliss, 1935: beetles killed out of the number tested at eight log₁₀ concentrations of carbon disulphide), the standard textbook example for probit analysis.

5.1 Model Fitting

# Grouped mortality: number killed out of n tested at each dose
dose   <- c(1.6907, 1.7242, 1.7552, 1.7842, 1.8113, 1.8369, 1.8610, 1.8839)
n      <- c(59, 60, 62, 56, 63, 59, 62, 60)
killed <- c(6, 13, 18, 28, 52, 53, 61, 60)

model <- glm(cbind(killed, n - killed) ~ dose,
             family = binomial(link = "probit"))

sm <- summary(model)$coefficients   # estimate, std. error, z value
wald <- sm[, "z value"]^2           # Wald chi-square on 1 df
cbind(sm, Wald = wald,
      p_Wald = pchisq(wald, df = 1, lower.tail = FALSE))

5.2 Effective Dose (LD / LC / LT) and Confidence Intervals

lev <- c(0.50, 0.90)                      # LD50 and LD90 (any level in 0-1)
ed  <- MASS::dose.p(model, p = lev)       # estimate on the fitted dose scale
est <- as.numeric(ed)
se  <- as.numeric(attr(ed, "SE"))         # delta-method standard error

z <- qnorm(0.975)                         # 95% CI (alpha = 0.05), delta method
data.frame(level    = paste0("LD", lev * 100),
           estimate = est,
           SE       = se,
           lower    = est - z * se,
           upper    = est + z * se)

# If a log10 dose scale is used, back-transform the estimate and interval
# (est_orig = 10^est) and report the SE on the same scale via the delta method:
#   se_orig = se * 10^est * log(10)

5.3 Model Fit and Pseudo R²

# Likelihood-ratio test of the overall dose effect
lr    <- model$null.deviance - model$deviance
lr_df <- model$df.null - model$df.residual
pchisq(lr, lr_df, lower.tail = FALSE)

# Pseudo R-squared at the individual (Bernoulli) level.
# N = total subjects; the null log-likelihood uses the overall response rate.
N   <- sum(n); r <- sum(killed); p0 <- r / N
ll0 <- r * log(p0) + (N - r) * log(1 - p0)   # individual-level null log-likelihood
R2_CS <- 1 - exp(-lr / N)                     # Cox & Snell
c(CoxSnell   = R2_CS,
  Nagelkerke = R2_CS / (1 - exp(2 * ll0 / N)))

5.4 Goodness of Fit

# Valid lack-of-fit test for GROUPED count data only.
pearson  <- sum(residuals(model, type = "pearson")^2)
deviance <- sum(residuals(model, type = "deviance")^2)
df       <- model$df.residual
data.frame(statistic = c("Pearson", "Deviance"),
           chisq = c(pearson, deviance),
           df    = df,
           p     = pchisq(c(pearson, deviance), df, lower.tail = FALSE))
# A large p-value indicates no evidence of lack of fit / overdispersion.

5.5 Fitted Dose-Response Curve

xs <- seq(min(dose), max(dose), length.out = 200)
pr <- predict(model, newdata = data.frame(dose = xs),
              type = "link", se.fit = TRUE)
z  <- qnorm(0.975)                        # 95% band
curve <- data.frame(dose = xs,
                    fitted = pnorm(pr$fit),
                    lower  = pnorm(pr$fit - z * pr$se.fit),
                    upper  = pnorm(pr$fit + z * pr$se.fit))
# Observed proportions killed/n are overlaid at each dose.

5.6 Bootstrap Confidence Interval for an Effective Dose

dat <- data.frame(dose = dose, dead = killed, alive = n - killed)

set.seed(42)                              # reproducible resampling
n_boot <- 1000
boot_ld50 <- replicate(n_boot, {
  idx <- sample(nrow(dat), replace = TRUE)               # case resampling
  bf  <- glm(cbind(dead, alive) ~ dose,
             family = binomial(link = "probit"), data = dat[idx, ])
  as.numeric(MASS::dose.p(bf, p = 0.5))
})
quantile(boot_ld50, c(0.025, 0.975), names = FALSE)      # percentile interval

Explore the entire Probit Dose/Time Response 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/

Finney, D. J. (1971). Probit Analysis (3rd ed.). Cambridge University Press.

Collett, D. (2003). Modelling Binary Data (2nd ed.). Chapman & Hall/CRC. https://doi.org/10.1201/b16654

Bliss, C. I. (1935). The calculation of the dosage-mortality curve. Annals of Applied Biology, 22(1), 134-167. https://doi.org/10.1111/j.1744-7348.1935.tb07713.x

Nagelkerke, N. J. D. (1991). A note on a general definition of the coefficient of determination. Biometrika, 78(3), 691-692. https://doi.org/10.1093/biomet/78.3.691

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.30). https://github.com/rstudio/rmarkdown

Feedback & Discussion