ShinyPSA | R Documentation |
An instance of this class is expected to produce summary plots and tables.
An R6::R6Class object.
CEP_plot
the Cost-Effectiveness plane.
CEAC_plot
the Cost-Effectiveness Acceptability Curve.
CEAF_plot
the Cost-Effectiveness Acceptability Frontier.
EVPI_plot
the Expected Value of Perfect Information.
eNMB_plot
the expected Net Monitory Benefit.
app
a list to store shiny app elements
new()
Initialisation method (triggered when a new object is created). Summary plots and table(s) are created alongside the construction of the plot.
ShinyPSA$new( .effs, .costs, .interventions = NULL, .ref = NULL, .Kmax = 1e+05, .wtp = NULL, .plot = TRUE )
.effs
A matrix containing the effects
from PSA.
Number of columns
is equal to the interventions while the
number of rows
is equal to the number of PSA simulations to
be summarised.
.costs
A matrix containing the costs
from PSA.
Number of columns
is equal to the interventions while the
number of rows
is equal to the number of PSA simulations to
be summarised.
.interventions
A vector containing the names of all
interventions. If not provided or less names than needed is
provided, the function will generate generic names, for example
intervention 1
.
.ref
An integer indicating the index of the reference
intervention. This parameter is ignored if more than two
interventions
are under analysis.
.Kmax
The maximum willingness-to-pay threshold to use in the
analysis. This parameter is ignored if wtp
is provided.
.wtp
A vector of numerical values declaring the
willingness-to-pay (WTP) values to use in the analysis. If
NULL
(default) a range of WTP values (up to .Kmax
will be used.
.plot
A boolean, FALSE (default), for whether to generate plots.
A new ShinyPSA
object.
\dontrun{ # Instantiate a copy of class ShinyPSA: PSA_outputs <- ShinyPSA$new( .effs = as_tibble(ShinyPSA::Vaccine_PSA$e), .costs = as_tibble(ShinyPSA::Vaccine_PSA$c), .interventions = ShinyPSA::Vaccine_PSA$treats) }
get_Summary_table()
Get the default results summary table
ShinyPSA$get_Summary_table( .wtp_ = c(20000, 30000), .units_ = "£", .effects_label = "QALYs" )
.wtp_
A numeric vector containing the willingness-to-pay
value(s) to be considered in the summary table. Default values are
c(20,000, 30,000)
.units_
A character, the units to associate with the
monitory values in the summary table. Default is sterling pounds
(GBP) £
.
.effects_label
The label or name to be given to the effects column in the summary table. Default is QALYs.
A ggplot2 object
\dontrun{ # Instantiate a copy of class ShinyPSA: PSA_outputs <- ShinyPSA$new( .effs = as_tibble(ShinyPSA::Vaccine_PSA$e), .costs = as_tibble(ShinyPSA::Vaccine_PSA$c), .interventions = ShinyPSA::Vaccine_PSA$treats) PSA_outputs$get_Summary_table() }
get_CEP()
Get the Cost-Effectiveness plane
ShinyPSA$get_CEP(...)
...
Extra arguments passed to the plotting functions
A ggplot2 object
\dontrun{ # Instantiate a copy of class ShinyPSA: PSA_outputs <- ShinyPSA$new( .effs = as_tibble(ShinyPSA::Vaccine_PSA$e), .costs = as_tibble(ShinyPSA::Vaccine_PSA$c), .interventions = ShinyPSA::Vaccine_PSA$treats) # Get default plot: PSA_outputs$get_CEP() PSA_outputs$get_CEP( .ref = 1, .show_ICER = T, .legend_pos = c(0.8, 0.2), .show_wtp = T, .zoom = T, .wtp_threshold = c(20000, 500, 100, 50), .nudge_labels = c(0.1, -0.1), .zoom_cords = c(-0.001, 0.001, -5, 5) ) }
get_CEAC()
Get the Cost-Effectiveness Acceptability Curve
ShinyPSA$get_CEAC(...)
...
Extra arguments passed to the plotting functions
A ggplot2 object
\dontrun{ # Instantiate a copy of class ShinyPSA: PSA_outputs <- ShinyPSA$new( .effs = as_tibble(ShinyPSA::Smoking_PSA$e), .costs = as_tibble(ShinyPSA::Smoking_PSA$c), .interventions = ShinyPSA::Smoking_PSA$treats) PSA_outputs$get_CEAC() }
get_CEAF()
Get the Cost-Effectiveness Acceptability Frontier
ShinyPSA$get_CEAF(...)
...
Extra arguments passed to the plotting functions
A ggplot2 object
\dontrun{ # Instantiate a copy of class ShinyPSA: PSA_outputs <- ShinyPSA$new( .effs = as_tibble(ShinyPSA::Smoking_PSA$e), .costs = as_tibble(ShinyPSA::Smoking_PSA$c), .interventions = ShinyPSA::Smoking_PSA$treats) PSA_outputs$get_CEAF() }
get_eNMB()
Get the expected Net Monitory Benefit
ShinyPSA$get_eNMB(...)
...
Extra arguments passed to the plotting functions
A ggplot2 object
\dontrun{ # Instantiate a copy of class ShinyPSA: PSA_outputs <- ShinyPSA$new( .effs = as_tibble(ShinyPSA::Smoking_PSA$e), .costs = as_tibble(ShinyPSA::Smoking_PSA$c), .interventions = ShinyPSA::Smoking_PSA$treats) PSA_outputs$get_eNMB() }
get_EVPI()
Get the Expected Value of Perfect Information
ShinyPSA$get_EVPI(...)
...
Extra arguments passed to the plotting functions
A ggplot2 object
\dontrun{ # Instantiate a copy of class ShinyPSA: PSA_outputs <- ShinyPSA$new( .effs = as_tibble(ShinyPSA::Smoking_PSA$e), .costs = as_tibble(ShinyPSA::Smoking_PSA$c), .interventions = ShinyPSA::Smoking_PSA$treats) PSA_outputs$get_EVPI() }
clone()
The objects of this class are cloneable with this method.
ShinyPSA$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `ShinyPSA$new` ## ------------------------------------------------ ## Not run: # Instantiate a copy of class ShinyPSA: PSA_outputs <- ShinyPSA$new( .effs = as_tibble(ShinyPSA::Vaccine_PSA$e), .costs = as_tibble(ShinyPSA::Vaccine_PSA$c), .interventions = ShinyPSA::Vaccine_PSA$treats) ## End(Not run) ## ------------------------------------------------ ## Method `ShinyPSA$get_Summary_table` ## ------------------------------------------------ ## Not run: # Instantiate a copy of class ShinyPSA: PSA_outputs <- ShinyPSA$new( .effs = as_tibble(ShinyPSA::Vaccine_PSA$e), .costs = as_tibble(ShinyPSA::Vaccine_PSA$c), .interventions = ShinyPSA::Vaccine_PSA$treats) PSA_outputs$get_Summary_table() ## End(Not run) ## ------------------------------------------------ ## Method `ShinyPSA$get_CEP` ## ------------------------------------------------ ## Not run: # Instantiate a copy of class ShinyPSA: PSA_outputs <- ShinyPSA$new( .effs = as_tibble(ShinyPSA::Vaccine_PSA$e), .costs = as_tibble(ShinyPSA::Vaccine_PSA$c), .interventions = ShinyPSA::Vaccine_PSA$treats) # Get default plot: PSA_outputs$get_CEP() PSA_outputs$get_CEP( .ref = 1, .show_ICER = T, .legend_pos = c(0.8, 0.2), .show_wtp = T, .zoom = T, .wtp_threshold = c(20000, 500, 100, 50), .nudge_labels = c(0.1, -0.1), .zoom_cords = c(-0.001, 0.001, -5, 5) ) ## End(Not run) ## ------------------------------------------------ ## Method `ShinyPSA$get_CEAC` ## ------------------------------------------------ ## Not run: # Instantiate a copy of class ShinyPSA: PSA_outputs <- ShinyPSA$new( .effs = as_tibble(ShinyPSA::Smoking_PSA$e), .costs = as_tibble(ShinyPSA::Smoking_PSA$c), .interventions = ShinyPSA::Smoking_PSA$treats) PSA_outputs$get_CEAC() ## End(Not run) ## ------------------------------------------------ ## Method `ShinyPSA$get_CEAF` ## ------------------------------------------------ ## Not run: # Instantiate a copy of class ShinyPSA: PSA_outputs <- ShinyPSA$new( .effs = as_tibble(ShinyPSA::Smoking_PSA$e), .costs = as_tibble(ShinyPSA::Smoking_PSA$c), .interventions = ShinyPSA::Smoking_PSA$treats) PSA_outputs$get_CEAF() ## End(Not run) ## ------------------------------------------------ ## Method `ShinyPSA$get_eNMB` ## ------------------------------------------------ ## Not run: # Instantiate a copy of class ShinyPSA: PSA_outputs <- ShinyPSA$new( .effs = as_tibble(ShinyPSA::Smoking_PSA$e), .costs = as_tibble(ShinyPSA::Smoking_PSA$c), .interventions = ShinyPSA::Smoking_PSA$treats) PSA_outputs$get_eNMB() ## End(Not run) ## ------------------------------------------------ ## Method `ShinyPSA$get_EVPI` ## ------------------------------------------------ ## Not run: # Instantiate a copy of class ShinyPSA: PSA_outputs <- ShinyPSA$new( .effs = as_tibble(ShinyPSA::Smoking_PSA$e), .costs = as_tibble(ShinyPSA::Smoking_PSA$c), .interventions = ShinyPSA::Smoking_PSA$treats) PSA_outputs$get_EVPI() ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.