From 0311f0658a276fab84e78c060b73c0b46c33b100 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Sun, 2 Apr 2023 16:58:56 +0200 Subject: Deal with covariates in summary for saem.mmkin objects --- R/summary.saem.mmkin.R | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'R') diff --git a/R/summary.saem.mmkin.R b/R/summary.saem.mmkin.R index 49b02a50..c470ccf0 100644 --- a/R/summary.saem.mmkin.R +++ b/R/summary.saem.mmkin.R @@ -15,6 +15,7 @@ #' included. #' @param digits Number of digits to use for printing #' @param \dots optional arguments passed to methods like \code{print}. +#' @inheritParams endpoints #' @return The summary function returns a list based on the [saemix::SaemixObject] #' obtained in the fit, with at least the following additional components #' \item{saemixversion, mkinversion, Rversion}{The saemix, mkin and R versions used} @@ -93,7 +94,9 @@ #' } #' #' @export -summary.saem.mmkin <- function(object, data = FALSE, verbose = FALSE, distimes = TRUE, ...) { +summary.saem.mmkin <- function(object, data = FALSE, verbose = FALSE, + covariates = NULL, covariate_quantile = 0.5, + distimes = TRUE, ...) { mod_vars <- names(object$mkinmod$diffs) @@ -199,6 +202,7 @@ summary.saem.mmkin <- function(object, data = FALSE, verbose = FALSE, distimes = } ep <- endpoints(object) + object$covariates <- ep$covariates if (length(ep$ff) != 0) object$ff <- ep$ff if (distimes) object$distimes <- ep$distimes @@ -281,6 +285,11 @@ print.summary.saem.mmkin <- function(x, digits = max(3, getOption("digits") - 3) print(x$confint_back, digits = digits) } + if (!is.null(x$covariates)) { + cat("\nCovariates used for endpoints below:\n") + print(x$covariates) + } + printSFORB <- !is.null(x$SFORB) if(printSFORB){ cat("\nEstimated Eigenvalues of SFORB model(s):\n") -- cgit v1.2.1