aboutsummaryrefslogtreecommitdiff
path: root/R/summary.mkinfit.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-05-29 16:05:11 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2020-05-29 16:05:11 +0200
commite6f9e9ca89e35e610d9895b979f1351a47451db0 (patch)
treedd9d389c05e35db7a86abd578751199cd2c6a1be /R/summary.mkinfit.R
parent510436646b1bdd5b8cfab70be29334bd3cc9c828 (diff)
Improve handling of warnings, reorganize tests
Diffstat (limited to 'R/summary.mkinfit.R')
-rw-r--r--R/summary.mkinfit.R16
1 files changed, 9 insertions, 7 deletions
diff --git a/R/summary.mkinfit.R b/R/summary.mkinfit.R
index 2c291ffd..f9858c32 100644
--- a/R/summary.mkinfit.R
+++ b/R/summary.mkinfit.R
@@ -122,7 +122,7 @@ summary.mkinfit <- function(object, data = TRUE, distimes = TRUE, alpha = 0.05,
date.fit = object$date,
date.summary = date(),
solution_type = object$solution_type,
- warning = object$warning,
+ warnings = object$summary_warnings,
use_of_ff = object$mkinmod$use_of_ff,
error_model_algorithm = object$error_model_algorithm,
df = c(p, rdf),
@@ -190,8 +190,6 @@ print.summary.mkinfit <- function(x, digits = max(3, getOption("digits") - 3), .
cat("Date of fit: ", x$date.fit, "\n")
cat("Date of summary:", x$date.summary, "\n")
- if (!is.null(x$warning)) cat("\n\nWarning:", x$warning, "\n\n")
-
cat("\nEquations:\n")
nice_diffs <- gsub("^(d.*) =", "\\1/dt =", x[["diffs"]])
writeLines(strwrap(nice_diffs, exdent = 11))
@@ -223,16 +221,20 @@ print.summary.mkinfit <- function(x, digits = max(3, getOption("digits") - 3), .
if(length(x$fixed$value) == 0) cat("None\n")
else print(x$fixed)
+ # We used to only have one warning - show this for summarising old objects
+ if (!is.null(x[["warning"]])) cat("\n\nWarning:", x$warning, "\n\n")
+
+ if (length(x$warnings) > 0) {
+ cat("\n\nWarning(s):", "\n")
+ cat(x$warnings, sep = "\n")
+ }
+
if (!is.null(x$AIC)) {
cat("\nResults:\n\n")
print(data.frame(AIC = x$AIC, BIC = x$BIC, logLik = x$logLik,
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))

Contact - Imprint