diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2019-11-04 17:21:04 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2019-11-04 17:29:48 +0100 |
commit | 31fd7412f46c9715962763d435cb0060ea420752 (patch) | |
tree | 771183a2c729131e7364f0a41dae967f73dc150e /R | |
parent | 0220b25f01a4451fa44a7b2f30f5849c4d822a9c (diff) |
Include fixed parameters in model names in lrtest
Diffstat (limited to 'R')
-rw-r--r-- | R/confint.mkinfit.R | 8 | ||||
-rw-r--r-- | R/lrtest.mkinfit.R | 18 |
2 files changed, 18 insertions, 8 deletions
diff --git a/R/confint.mkinfit.R b/R/confint.mkinfit.R index 84183808..78dda95d 100644 --- a/R/confint.mkinfit.R +++ b/R/confint.mkinfit.R @@ -4,10 +4,10 @@ #' the curvature of the likelihood function at the maximum likelihood parameter #' estimates. #' The alternative method 'profile' is based on the profile likelihood for each -#' parameter. The method uses two nested optimisations and can take a very long -#' time, even if parallelized by specifying 'cores' on unixoid platforms. The -#' speed of the method could likely be improved by using the method of Venzon -#' and Moolgavkar (1988). +#' parameter. The 'profile' method uses two nested optimisations and can take a +#' very long time, even if parallelized by specifying 'cores' on unixoid +#' platforms. The speed of the method could likely be improved by using the +#' method of Venzon and Moolgavkar (1988). #' #' @param object An \code{\link{mkinfit}} object #' @param parm A vector of names of the parameters which are to be given diff --git a/R/lrtest.mkinfit.R b/R/lrtest.mkinfit.R index 60b6c46a..a5689830 100644 --- a/R/lrtest.mkinfit.R +++ b/R/lrtest.mkinfit.R @@ -30,17 +30,27 @@ lmtest::lrtest #' dfop_fit <- mkinfit("DFOP", test_data, quiet = TRUE) #' lrtest(dfop_fit, sfo_fit) #' lrtest(sfo_fit, dfop_fit) -#' +#' #' # The following two examples are commented out as they fail during #' # generation of the static help pages by pkgdown -#' # lrtest(dfop_fit, error_model = "tc") -#' # lrtest(dfop_fit, fixed_parms = c(k2 = 0)) +#' #lrtest(dfop_fit, error_model = "tc") +#' #lrtest(dfop_fit, fixed_parms = c(k2 = 0)) +#' +#' # However, this equivalent syntax works for static help pages +#' lrtest(dfop_fit, update(dfop_fit, error_model = "tc")) +#' lrtest(dfop_fit, update(dfop_fit, fixed_parms = c(k2 = 0))) #' } #' @export lrtest.mkinfit <- function(object, object_2 = NULL, ...) { name_function <- function(x) { - paste(x$mkinmod$name, "with error model", x$err_mod) + object_name <- paste(x$mkinmod$name, "with error model", x$err_mod) + if (length(x$bparms.fixed) > 0) { + object_name <- paste(object_name, + "and fixed parameter(s)", + paste(names(x$bparms.fixed), collapse = ", ")) + } + return(object_name) } if (is.null(object_2)) { |