diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2022-12-15 14:50:28 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2022-12-15 14:50:28 +0100 |
commit | a54bd290bc3884d0000c52c1b29bc557825d9eae (patch) | |
tree | 841dc41b03035677aac0b288bca4927a0bd18582 /R/intervals.R | |
parent | 7c8b3db180be371cb03b9518f14117060fbc4239 (diff) |
List random effects correlations in output if any
Update docs
Diffstat (limited to 'R/intervals.R')
-rw-r--r-- | R/intervals.R | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/R/intervals.R b/R/intervals.R index 705ef6eb..fcdbaea9 100644 --- a/R/intervals.R +++ b/R/intervals.R @@ -78,8 +78,12 @@ intervals.saem.mmkin <- function(object, level = 0.95, backtransform = TRUE, ... # Random effects sdnames <- intersect(rownames(conf.int), paste("SD", pnames, sep = ".")) - ranef_ret <- as.matrix(conf.int[sdnames, c("lower", "est.", "upper")]) - rownames(ranef_ret) <- paste0(gsub("SD\\.", "sd(", sdnames), ")") + corrnames <- grep("^Corr.", rownames(conf.int), value = TRUE) + ranef_ret <- as.matrix(conf.int[c(sdnames, corrnames), c("lower", "est.", "upper")]) + sdnames_ret <- paste0(gsub("SD\\.", "sd(", sdnames), ")") + corrnames_ret <- gsub("Corr\\.(.*)\\.(.*)", "corr(\\1,\\2)", corrnames) + rownames(ranef_ret) <- c(sdnames_ret, corrnames_ret) + attr(ranef_ret, "label") <- "Random effects:" |