Skip to content

Commit

Permalink
Update references to book, updates for roxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
chjackson committed Feb 17, 2024
1 parent a546026 commit 65b2557
Show file tree
Hide file tree
Showing 31 changed files with 2,977 additions and 2,340 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: voi
Title: Expected Value of Information
Version: 1.0.2
Date: 2023-11-27
Version: 1.0.3
Date: 2024-02-17
Authors@R:
c(person(given = "Christopher", family = "Jackson",role = c("aut", "cre"),email = "chris.jackson@mrc-bsu.cam.ac.uk"),
person(given = "Anna", family = "Heath", role = c("aut"), email = "anna.heath@sickkids.ca"),
Expand All @@ -10,15 +10,15 @@ Authors@R:
person(given="Kofi Placid", family="Adragni", role="ctb", comment="Author of code taken from the ldr package"),
person(given="Andrew", family="Raim", role="ctb",comment="Author of code taken from the ldr package")
)
Description: Methods to calculate the expected value of information from a decision-analytic model. This includes the expected value of perfect information (EVPI), partial perfect information (EVPPI) and sample information (EVSI), and the expected net benefit of sampling (ENBS). A range of alternative computational methods are provided under the same user interface. See Jackson et al. (2022) <doi:10.1146/annurev-statistics-040120-010730>.
Description: Methods to calculate the expected value of information from a decision-analytic model. This includes the expected value of perfect information (EVPI), partial perfect information (EVPPI) and sample information (EVSI), and the expected net benefit of sampling (ENBS). A range of alternative computational methods are provided under the same user interface. See Heath et al. (2024) <doi:10.1201/9781003156109>, Jackson et al. (2022) <doi:10.1146/annurev-statistics-040120-010730>.
License: GPL-3
Encoding: UTF-8
LazyData: true
Depends: R (>= 3.5.0)
VignetteBuilder: knitr
Imports: mgcv, earth, mvtnorm, progress, dbarts, posterior, ggplot2, gridExtra, Matrix
Suggests: testthat, BCEA, INLA, splancs, sf, knitr, rmarkdown, rjags, truncnorm, scales, dplyr, heemod
RoxygenNote: 7.2.3
RoxygenNote: 7.3.0
Roxygen: list(markdown = TRUE)
URL: https://chjackson.github.io/voi/
BugReports: https://github.com/chjackson/voi/issues
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Version 1.0.3

* Citations to published book ([Heath et al](https://doi.org/10.1201/9781003156109)) added.


# Version 1.0.2

* Fix for test of reference option
Expand Down
8 changes: 7 additions & 1 deletion R/evppi.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@
##' a posterior standard deviation). These represent uncertainty about the
##' parameters of the fitted regression model, and will naturally be lower when
##' more simulations from the decision model are used to fit it. They do not
##' represent uncertainty about the structure of the regression model,
##' represent uncertainty about the structure of the regression model, and are
##' also typically small in the context of uncertainties arising from
##' converting individual-level to population VoI.
##'
##' @param B Number of parameter replicates for calculating the standard error.
##' Only applicable to \code{method="gam"}. For \code{method="bart"} the
Expand Down Expand Up @@ -208,6 +210,8 @@
#'
##' @references
##'
##' Heath, A., Kunst, N., & Jackson, C. (eds.). (2024). Value of Information for Healthcare Decision-Making. CRC Press.
##'
##' Strong, M., Oakley, J. E., & Brennan, A. (2014). Estimating multiparameter
##' partial expected value of perfect information from a probabilistic
##' sensitivity analysis sample: a nonparametric regression approach. Medical
Expand Down Expand Up @@ -303,12 +307,14 @@ subset_outputs <- function(outputs, ...){
UseMethod("subset_outputs", outputs)
}

##' @noRd
subset_outputs.nb <- function(outputs, nsim, ...){
outputs <- outputs[1:nsim,,drop=FALSE]
class(outputs) <- c("nb", attr(outputs, "class"))
outputs
}

##' @noRd
subset_outputs.cea <- function(outputs, nsim, ...){
outputs$c <- outputs$c[1:nsim,,drop=FALSE]
outputs$e <- outputs$e[1:nsim,,drop=FALSE]
Expand Down
2 changes: 2 additions & 0 deletions R/evppi_mc.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ evppimc <- function(model_fn, ...){
UseMethod("evppimc", model_fn)
}

##' @noRd
evppimc.nb <- function(model_fn, par_fn, pars, pars_rep, nouter, ninner, nopt, mfargs, ...) {
nb_current <- matrix(nrow=nouter, ncol=nopt)
nb_ppi <- numeric(nouter)
Expand All @@ -121,6 +122,7 @@ evppimc.nb <- function(model_fn, par_fn, pars, pars_rep, nouter, ninner, nopt, m
mean(nb_ppi) - max(colMeans(nb_current))
}

##' @noRd
evppimc.cea <- function(model_fn, par_fn, pars, pars_rep, nouter, ninner, nopt, wtp, mfargs, ...) {
nwtp <- length(wtp)
if (nwtp < 1)
Expand Down
2 changes: 2 additions & 0 deletions R/evppi_npreg.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ evppi_npreg <- function(outputs, ...){
UseMethod("evppi_npreg", outputs)
}

##' @noRd
evppi_npreg.nb <- function(outputs, inputs, pars, method, se, B, verbose, ...){
if (verbose) message("Fitting nonparametric regression")
fit <- fitted_npreg(outputs, inputs=inputs, pars=pars, method=method, se=se, B=B,
Expand All @@ -23,6 +24,7 @@ evppi_npreg.nb <- function(outputs, inputs, pars, method, se, B, verbose, ...){
res
}

##' @noRd
evppi_npreg.cea <- function(outputs, inputs, pars, method, se, B, verbose, ...){
wtp <- outputs$k
if (verbose) message("Fitting nonparametric regression for costs")
Expand Down
2 changes: 2 additions & 0 deletions R/evsi.R
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@
##' \code{k} identifies the willingness-to-pay.
##'
##' @references
##'
##' Heath, A., Kunst, N., & Jackson, C. (eds.). (2024). Value of Information for Healthcare Decision-Making. CRC Press.
##'
##' Strong, M., Oakley, J. E., Brennan, A., & Breeze, P. (2015). Estimating the
##' expected value of sample information using the probabilistic sensitivity
Expand Down
4 changes: 4 additions & 0 deletions R/model.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ check_model_fn <- function(model_fn, par_fn, mfargs=NULL, outputs=NULL, verbose=
describe_modelfn <- function(model_fn, ...){
UseMethod("describe_modelfn", model_fn)
}

##' @noRd
describe_modelfn.nb <- function(model_fn, ...){
plural <- if (attr(model_fn, "nopt") > 1) "s" else ""
message(sprintf("model_fn returns net benefit for %s decision option%s", attr(model_fn, "nopt"), plural))
}

##' @noRd
describe_modelfn.cea <- function(model_fn, ...){
plural <- if (attr(model_fn, "nopt") > 1) "s" else ""
message(sprintf("model_fn returns effects and costs for %s decision option%s", attr(model_fn, "nopt"), plural))
Expand Down
5 changes: 3 additions & 2 deletions R/voi-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
##'
##' @references
##'
##' Heath, A., Kunst, N., & Jackson, C. (eds.). (2024). Value of Information for Healthcare Decision-Making. CRC Press.
##'
##' Heath, A., Manolopoulou, I., & Baio, G. (2017). A review of methods for analysis of the expected value of information. Medical Decision Making, 37(7), 747-758.
##'
##' Heath, A., Kunst, N., Jackson, C., Strong, M., Alarid-Escudero, F., Goldhaber-Fiebert, J. D., Baio, G. Menzies, N.A, Jalal, H. (2020). Calculating the Expected Value of Sample Information in Practice: Considerations from 3 Case Studies. Medical Decision Making, 40(3), 314-326.
Expand All @@ -24,7 +26,6 @@
##'
##' @name voi-package
##' @aliases voi-package
##' @docType package
##'
##' @importFrom grDevices dev.off
##' @importFrom graphics points hist par
Expand All @@ -35,4 +36,4 @@
##' @importFrom progress progress_bar
##' @importFrom Matrix nearPD
##'
NULL
"_PACKAGE"
9 changes: 6 additions & 3 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions docs/TODO.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 65b2557

Please sign in to comment.