From 510436646b1bdd5b8cfab70be29334bd3cc9c828 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 29 May 2020 15:03:04 +0200 Subject: Warn if standardized residuals are unlikely normal This revealed a bug in the data returned in mkinfit$data in the case of the d_3 algorithm, which also affected the residual plot - the data from the direct fitting was not returned even if this was the better method. --- R/summary.mkinfit.R | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'R/summary.mkinfit.R') diff --git a/R/summary.mkinfit.R b/R/summary.mkinfit.R index 2dc74bd7..2c291ffd 100644 --- a/R/summary.mkinfit.R +++ b/R/summary.mkinfit.R @@ -165,6 +165,7 @@ summary.mkinfit <- function(object, data = TRUE, distimes = TRUE, alpha = 0.05, } ans$bparms.ode <- object$bparms.ode + ans$shapiro.p <- object$shapiro.p ep <- endpoints(object) if (length(ep$ff) != 0) ans$ff <- ep$ff @@ -228,6 +229,10 @@ print.summary.mkinfit <- function(x, digits = max(3, getOption("digits") - 3), . row.names = " ")) } + if (!is.null(x$shapiro.p) && x$shapiro.p < 0.05) { + warning("The p-value for the Shapiro-Wilk test of normality on standardized residuals is < 0.05") + } + cat("\nOptimised, transformed parameters with symmetric confidence intervals:\n") print(signif(x$par, digits = digits)) -- cgit v1.2.1