From 8ba0bc6f52183ad97377e4d13d082be13b0383bd Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 9 Nov 2020 11:50:02 +0100 Subject: Fix std in summary.nlme.mmkin(..., data = TRUE) --- R/summary.nlme.mmkin.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/summary.nlme.mmkin.R b/R/summary.nlme.mmkin.R index 7e404e00..d930f845 100644 --- a/R/summary.nlme.mmkin.R +++ b/R/summary.nlme.mmkin.R @@ -131,7 +131,11 @@ summary.nlme.mmkin <- function(object, data = FALSE, verbose = FALSE, distimes = object$data[["value"]] <- NULL object$data[["predicted"]] <- predict(object) object$data[["residual"]] <- residuals(object, type = "response") - object$data[["std"]] <- object$sigma <- 1/attr(object$modelStruct$varStruct, "weights") + if (is.null(object$modelStruct$varStruct)) { + object$data[["std"]] <- object$sigma + } else { + object$data[["std"]] <- 1/attr(object$modelStruct$varStruct, "weights") + } object$data[["standardized"]] <- residuals(object, type = "pearson") object$verbose <- verbose -- cgit v1.2.1