From a1b5d63e031d22b190e9e9fc30753b699ad6b4ea Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 23 Nov 2023 05:20:17 +0100 Subject: fix: 'R/illparms.R': An ill-defined random effect is now also found if there is only one random effect in the model. Also add a test for this. --- R/illparms.R | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'R') diff --git a/R/illparms.R b/R/illparms.R index 68a6bff6..b4b37fbb 100644 --- a/R/illparms.R +++ b/R/illparms.R @@ -102,12 +102,14 @@ illparms.saem.mmkin <- function(object, conf.level = 0.95, random = TRUE, errmod ints <- intervals(object, conf.level = conf.level) ill_parms <- character(0) if (random) { - ill_parms_random <- ints$random[, "lower"] < 0 - ill_parms <- c(ill_parms, names(which(ill_parms_random))) + ill_parms_random_i <- which(ints$random[, "lower"] < 0) + ill_parms_random <- rownames(ints$random)[ill_parms_random_i] + ill_parms <- c(ill_parms, ill_parms_random) } if (errmod) { - ill_parms_errmod <- ints$errmod[, "lower"] < 0 & ints$errmod[, "upper"] > 0 - ill_parms <- c(ill_parms, names(which(ill_parms_errmod))) + ill_parms_errmod_i <- which(ints$errmod[, "lower"] < 0 & ints$errmod[, "upper"] > 0) + ill_parms_errmod <- rownames(ints$errmod)[ill_parms_errmod_i] + ill_parms <- c(ill_parms, ill_parms_errmod) } if (slopes) { if (is.null(object$so)) stop("Slope testing is only implemented for the saemix backend") -- cgit v1.2.1