aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2023-11-23 05:20:17 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2023-11-23 05:33:55 +0100
commita1b5d63e031d22b190e9e9fc30753b699ad6b4ea (patch)
treed2c2cd104e08681568b1293ef3266396b702a619 /R
parent8b7edd4eaf0d196e674a085f744d1a69260a6c91 (diff)
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.
Diffstat (limited to 'R')
-rw-r--r--R/illparms.R10
1 files changed, 6 insertions, 4 deletions
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")

Contact - Imprint