From 04ad98da7fdc93fbab29fc8e7c4f2f17cf5c1ddb Mon Sep 17 00:00:00 2001 From: Dr Nathan Green Date: Mon, 13 Jan 2025 21:22:30 +0000 Subject: [PATCH] added BCEA:: to evppi() calls in @examples so doesnt clash with voi version of evppi() --- R/evppi.R | 15 ++++++++------- R/evppi.default.R | 3 ++- R/inforank_params.R | 8 ++++---- R/plot.evppi.R | 4 ++-- man/evppi.Rd | 18 ++++++++++-------- man/plot.evppi.Rd | 4 ++-- 6 files changed, 28 insertions(+), 24 deletions(-) diff --git a/R/evppi.R b/R/evppi.R index ea38fffc..193edb63 100644 --- a/R/evppi.R +++ b/R/evppi.R @@ -161,26 +161,27 @@ #' # Compute the EVPPI for a bunch of parameters #' inp <- createInputs(vaccine_mat) #' -#' EVPPI <- evppi(m, c("beta.1." , "beta.2."), inp$mat) +#' # explicitly use BCEA package namespace to avoid voi package conflict +#' EVPPI <- BCEA::evppi(m, c("beta.1." , "beta.2."), inp$mat) #' #' plot(EVPPI) #' #' # deprecated (single parameter) methods -#' EVPPI.so <- evppi(m, c("beta.1.", "beta.2."), inp$mat, method = "so", n.blocks = 50) -#' EVPPI.sad <- evppi(m, c("beta.1.", "beta.2."), inp$mat, method = "sad", n.seps = 1) +#' EVPPI.so <- BCEA::evppi(m, c("beta.1.", "beta.2."), inp$mat, method = "so", n.blocks = 50) +#' EVPPI.sad <- BCEA::evppi(m, c("beta.1.", "beta.2."), inp$mat, method = "sad", n.seps = 1) #' #' plot(EVPPI.so) #' plot(EVPPI.sad) #' #' # Compute the EVPPI using INLA/SPDE #' if (require("INLA")) -#' x_inla <- evppi(he = m, 39:40, input = inp$mat) +#' x_inla <- BCEA::evppi(he = m, 39:40, input = inp$mat) #' #' # using GAM regression -#' x_gam <- evppi(he = m, 39:40, input = inp$mat, method = "GAM") +#' x_gam <- BCEA::evppi(he = m, 39:40, input = inp$mat, method = "GAM") #' #' # using Strong et al GP regression -#' x_gp <- evppi(he = m, 39:40, input = inp$mat, method = "GP") +#' x_gp <- BCEA::evppi(he = m, 39:40, input = inp$mat, method = "GP") #' #' # plot results #' if (require("INLA")) plot(x_inla) @@ -199,7 +200,7 @@ #' "Individual counselling", "Group counselling") #' m <- bcea(eff, cost, ref = 4, interventions = treats, Kmax = 500) #' inp <- createInputs(smoking_output) -#' EVPPI <- evppi(m, c(2,3), inp$mat, h.value = 0.0000005) +#' EVPPI <- BCEA::evppi(m, c(2,3), inp$mat, h.value = 0.0000005) #' plot(EVPPI) #' } #' diff --git a/R/evppi.default.R b/R/evppi.default.R index 32484451..cbad36ee 100644 --- a/R/evppi.default.R +++ b/R/evppi.default.R @@ -14,7 +14,8 @@ evppi.default <- function(he, ...) { #' treats <- c("Status quo", "Vaccination") #' bcea_vacc <- bcea(e.pts, c.pts, ref = 2, interventions = treats) #' inp <- createInputs(vaccine_mat) -#' evppi(bcea_vacc, c("beta.1.", "beta.2."), inp$mat) +#' BCEA::evppi(bcea_vacc, c("beta.1.", "beta.2."), inp$mat) +#' #' @export #' evppi.bcea <- function(he, diff --git a/R/inforank_params.R b/R/inforank_params.R index cdfa5fe4..a50ac867 100644 --- a/R/inforank_params.R +++ b/R/inforank_params.R @@ -77,10 +77,10 @@ inforank_params <- function(he, for (i in seq_along(chk2)) { x[[i]] <- quiet( - evppi(he = m, - param_idx = chk2[i], - input = input, - N = N)) + BCEA::evppi(he = m, + param_idx = chk2[i], + input = input, + N = N)) } scores <- diff --git a/R/plot.evppi.R b/R/plot.evppi.R index 13f8c669..0035aa96 100644 --- a/R/plot.evppi.R +++ b/R/plot.evppi.R @@ -38,11 +38,11 @@ #' #' # Compute the EVPPI using INLA/SPDE #' if (require("INLA")) { -#' x0 <- evppi(m, c("beta.1." , "beta.2."), input = inp$mat) +#' x0 <- BCEA::evppi(m, c("beta.1." , "beta.2."), input = inp$mat) #' #' plot(x0, pos = c(0,1)) #' -#' x1 <- evppi(m, c(32,48,49), input = inp$mat) +#' x1 <- BCEA::evppi(m, c(32,48,49), input = inp$mat) #' plot(x1, pos = "topright") #' #' plot(x0, col = c("black", "red"), pos = "topright") diff --git a/man/evppi.Rd b/man/evppi.Rd index f12f75bf..2adcc101 100644 --- a/man/evppi.Rd +++ b/man/evppi.Rd @@ -180,26 +180,27 @@ m <- bcea(e.pts, c.pts, ref = 2, interventions = treats) # Compute the EVPPI for a bunch of parameters inp <- createInputs(vaccine_mat) -EVPPI <- evppi(m, c("beta.1." , "beta.2."), inp$mat) +# explicitly use BCEA package namespace to avoid voi package conflict +EVPPI <- BCEA::evppi(m, c("beta.1." , "beta.2."), inp$mat) plot(EVPPI) # deprecated (single parameter) methods -EVPPI.so <- evppi(m, c("beta.1.", "beta.2."), inp$mat, method = "so", n.blocks = 50) -EVPPI.sad <- evppi(m, c("beta.1.", "beta.2."), inp$mat, method = "sad", n.seps = 1) +EVPPI.so <- BCEA::evppi(m, c("beta.1.", "beta.2."), inp$mat, method = "so", n.blocks = 50) +EVPPI.sad <- BCEA::evppi(m, c("beta.1.", "beta.2."), inp$mat, method = "sad", n.seps = 1) plot(EVPPI.so) plot(EVPPI.sad) # Compute the EVPPI using INLA/SPDE if (require("INLA")) - x_inla <- evppi(he = m, 39:40, input = inp$mat) + x_inla <- BCEA::evppi(he = m, 39:40, input = inp$mat) # using GAM regression -x_gam <- evppi(he = m, 39:40, input = inp$mat, method = "GAM") +x_gam <- BCEA::evppi(he = m, 39:40, input = inp$mat, method = "GAM") # using Strong et al GP regression -x_gp <- evppi(he = m, 39:40, input = inp$mat, method = "GP") +x_gp <- BCEA::evppi(he = m, 39:40, input = inp$mat, method = "GP") # plot results if (require("INLA")) plot(x_inla) @@ -218,7 +219,7 @@ treats <- c("No intervention", "Self-help", "Individual counselling", "Group counselling") m <- bcea(eff, cost, ref = 4, interventions = treats, Kmax = 500) inp <- createInputs(smoking_output) -EVPPI <- evppi(m, c(2,3), inp$mat, h.value = 0.0000005) +EVPPI <- BCEA::evppi(m, c(2,3), inp$mat, h.value = 0.0000005) plot(EVPPI) } @@ -226,7 +227,8 @@ data(Vaccine, package = "BCEA") treats <- c("Status quo", "Vaccination") bcea_vacc <- bcea(e.pts, c.pts, ref = 2, interventions = treats) inp <- createInputs(vaccine_mat) -evppi(bcea_vacc, c("beta.1.", "beta.2."), inp$mat) +BCEA::evppi(bcea_vacc, c("beta.1.", "beta.2."), inp$mat) + } \references{ \insertRef{Strong2014}{BCEA} diff --git a/man/plot.evppi.Rd b/man/plot.evppi.Rd index d5e4338d..74b9a5ff 100644 --- a/man/plot.evppi.Rd +++ b/man/plot.evppi.Rd @@ -51,11 +51,11 @@ inp <- createInputs(vaccine_mat) # Compute the EVPPI using INLA/SPDE if (require("INLA")) { - x0 <- evppi(m, c("beta.1." , "beta.2."), input = inp$mat) + x0 <- BCEA::evppi(m, c("beta.1." , "beta.2."), input = inp$mat) plot(x0, pos = c(0,1)) - x1 <- evppi(m, c(32,48,49), input = inp$mat) + x1 <- BCEA::evppi(m, c(32,48,49), input = inp$mat) plot(x1, pos = "topright") plot(x0, col = c("black", "red"), pos = "topright")