ShinyPSA: R6 Class representing a PSA summarising machine.

ShinyPSAR Documentation

R6 Class representing a PSA summarising machine.

Description

An instance of this class is expected to produce summary plots and tables.

Format

An R6::R6Class object.

Public fields

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

Methods

Public methods


Method new()

Initialisation method (triggered when a new object is created). Summary plots and table(s) are created alongside the construction of the plot.

Usage
ShinyPSA$new(
  .effs,
  .costs,
  .interventions = NULL,
  .ref = NULL,
  .Kmax = 1e+05,
  .wtp = NULL,
  .plot = TRUE
)
Arguments
.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.

Returns

A new ShinyPSA object.

Examples
\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)
}

Method get_Summary_table()

Get the default results summary table

Usage
ShinyPSA$get_Summary_table(
  .wtp_ = c(20000, 30000),
  .units_ = "£",
  .effects_label = "QALYs"
)
Arguments
.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.

Returns

A ggplot2 object

Examples
\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()
}

Method get_CEP()

Get the Cost-Effectiveness plane

Usage
ShinyPSA$get_CEP(...)
Arguments
...

Extra arguments passed to the plotting functions

Returns

A ggplot2 object

Examples
\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)
  )
}

Method get_CEAC()

Get the Cost-Effectiveness Acceptability Curve

Usage
ShinyPSA$get_CEAC(...)
Arguments
...

Extra arguments passed to the plotting functions

Returns

A ggplot2 object

Examples
\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()
}

Method get_CEAF()

Get the Cost-Effectiveness Acceptability Frontier

Usage
ShinyPSA$get_CEAF(...)
Arguments
...

Extra arguments passed to the plotting functions

Returns

A ggplot2 object

Examples
\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()
}

Method get_eNMB()

Get the expected Net Monitory Benefit

Usage
ShinyPSA$get_eNMB(...)
Arguments
...

Extra arguments passed to the plotting functions

Returns

A ggplot2 object

Examples
\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()
}

Method get_EVPI()

Get the Expected Value of Perfect Information

Usage
ShinyPSA$get_EVPI(...)
Arguments
...

Extra arguments passed to the plotting functions

Returns

A ggplot2 object

Examples
\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()
}

Method clone()

The objects of this class are cloneable with this method.

Usage
ShinyPSA$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples


## ------------------------------------------------
## 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)

W-Mohammed/ShinyPSA documentation built on April 24, 2022, 6:57 p.m.