Package {EBASS}


Type: Package
Title: Expected Value of Information Based Sample Size Calculation
Version: 0.1.1
Maintainer: Audrey Cordon <audrey.cordon@chu-bordeaux.fr>
URL: https://github.com/aud33/EBASS
BugReports: https://github.com/aud33/EBASS/issues
Description: Computes sample sizes for trial-based cost-effectiveness analyses using the expected value of information. The implementation follows the method described by Bader et al. (2018) <doi:10.1186/s12874-018-0571-1>.
License: GPL (≥ 3)
Encoding: UTF-8
RoxygenNote: 7.3.3
Collate: 'POP.R' 'INMB_DIRECT.R' 'VAR_INMB_DIRECT.R' 'EVPI.R' 'internal.R' 'INMB.R' 'Lambda.R' 'VAR_INMB.R' 'VAR_INMB_DIFF.R' 'fonctions_sujets.R'
Imports: methods
Suggests: knitr, rmarkdown
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2026-07-24 10:04:27 UTC; cordaud
Author: Audrey Cordon [aut, cre], Clement Bader [ctb], Morgane Donadel [ctb], Aline Maillard [ctb], Sebastien Cossin [ctb], Mohamedou Sow [ctb], Antoine Benard [ctb]
Repository: CRAN
Date/Publication: 2026-08-04 09:50:07 UTC

Internal mypackage Functions

Description

Internal mypackage functions

Details

These are not to be called by the user.


A Reference Class to represent the EVPI

Description

An object that combines three others objects : object_inmb, object_pop, object_var_inmb.

Fields

object_inmb

An instance that inherits the INMB_DIRECT

object_var_inmb

An instance that inherits the VAR_INMB_DIRECT

object_pop

: an instance that inherits the POP

step_ref

(default=1) : to define the ratio (step_ref/step_exp) for group allocation during the study

step_exp

(default=1) : to define the ratio (step_ref/step_exp) for group allocation during the study

Methods

get_N():

return the estimated optimal sample size for the study

get_N_exp():

return the estimated number of individuals in the experimental group

get_N_ref():

return the estimated number of participants to include in the reference group

get_k(N_exp):

return the ratio (step_ref/step_exp) for group allocation

set_N_ref(N_ref):

sets the number of individuals in the reference group (N_exp will be automatically calculated according to the ratio)

set_N_exp(N_exp):

sets the number of individuals in the experimental group (N_ref will be automatically calculated according to the ratio)

set_object_inmb(object_inmb):

sets object_inmb for this EVPI_DECREASE object

set_object_var_inmb(object_var_inmb):

sets object_var_inmb for this EVPI_DECREASE object

set_object_pop(object_pop):

sets object_pop for this EVPI_DECREASE object


A Reference Class to represent the INMB (Incremental Net Monetary Benefit)

Description

The net monetary benefit (NMB) of an intervention is given by E x Lambda - C, where E and C are the effectiveness and cost of this intervention, and Lambda is the threshold value for a unit of effectiveness, the ceiling incremental cost-effectiveness ratio. When the NMB is positive, the value of the intervention's effectiveness overpasses its cost. When evaluating the cost-effectiveness of a new intervention in comparison with the reference, one can estimate the difference between the net monetary benefit of the new or experimental intervention (NMBn) and the net monetary benefit of the reference (NMBr). This difference is known as the incremental net monetary benefit (INMB), which is given by: INMB = NMBn - NMBr = de x lambda - dc. The new intervention is cost-effective if INMB is positive.

Fields

de

: Expected point estimate of the difference in mean effectiveness (effectiveness in the experimental group minus effectiveness in the reference group)

dc

: Expected point estimate of the difference in mean cost (cost in the experimental group minus cost in the reference group)

object_lambda

: object containing the ceiling cost-effectiveness ratio or maximum acceptable cost of a unit of effectiveness. See create_object_lambda

Methods

get_inmb():

Returns the calculated Incremental Net Monetary Benefit (inmb)

set_dc(dc):

sets the dc of this INMB object

set_de(de):

sets the de of this INMB object

set_object_lambda(object_lambda):

sets the object_lambda of this INMB object

See Also

INMB_DIRECT the parent class

create_object_inmb the constructor

Examples

## First, create a lambda object
object_lambda <- create_object_lambda (20000)
## Then, create an inmb object
object_inmb <- create_object_inmb(de = 0.04, dc=-168, object_lambda = object_lambda)
## inmb is calculated by methods inside the object. Retrieve the inmb :
object_inmb$get_inmb()

A Reference Class to represent the INMB (Incremental Net Monetary Benefit)

Description

If the INMB can be drawn from de, dc and lambda with create_object_inmb, one can also make directly an hypothesis on the value of the INMB.

Fields

inmb

: INMB expected Incremental Net monetary Benefit.

Methods

get_inmb():

Returns the Incremental Net Monetary Benefit (inmb)

set_inmb(inmb):

sets the inmb of this INMB_DIRECT object

See Also

create_object_inmb_direct the constructor

create_object_inmb to calculate the INMB


A Reference Class to represent the lambda value

Description

Lambda is known as the willingness to pay. That is the ceiling cost-effectiveness ratio or the maximum acceptable cost of a unit of effectiveness.

Fields

lambda

: Lambda is a monetary value. For example, the value of lambda is usually between 20 000 and 40 000 pounds/QALY in UK.

Methods

set_lambda(lambda):

sets the lambda value of this Lambda object

See Also

create_object_lambda the constructor


A Reference Class to represent the target population

Description

The expected value of perfect information (EVPI) is estimated for the entire population targeted by the evaluated intervention.

Fields

horizon

: Time horizon in years considered in the estimation of the EVPI. Finite time horizons are recommended in order to control for the complex and uncertain process of future changes. Furthermore, because of discounting, the impact of a time horizon over 15 or 20 years on the estimation of EVPI is insignificant.

discount

: Annual discount rate considered in the estimation of the EVPI. The annual discount rate is defined in each country, usually within 3 to 6%.

N_year

: Number of individuals likely to be targeted by the evaluated intervention each year

Methods

set_discount(discount):

sets the discount for this POP object

set_N_year(N_year):

sets the N_year of this POP object

set_horizon(horizon):

sets the horizon of this POP object

See Also

create_object_pop the constructor

Examples

object_pop <- create_object_pop(horizon = 20, discount=0.04, N_year = 52000)

A Reference Class to represent the Hypothetical variance of the Incremental Net Monetary Benefit

Description

Hypothetical variance of the Incremental Net Monetary Benefit.

Fields

sdc

: common standard deviation of costs in each group

sde

: common standard deviation of effectiveness in each group

rho

: coefficient of correlation between the difference in costs (dc) and the difference in effectiveness (de)

object_lambda

: an object lambda. Create one with create_object_lambda. It contains lambda : the ceiling cost-effectiveness ratio or maximum acceptable cost of a unit of effectiveness

Methods

set_sdc(sdc):

Sets the common standard deviation of costs in each group for this VAR_INMB object

set_sde(sde):

Sets the common standard deviation of effectiveness in each group for this VAR_INMB object

set_rho(rho):

Sets the coefficient of correlation between the difference in costs (dc) and the difference in effectiveness (de)

set_object_lambda(object_lambda):

Sets the object_lambda of this VAR_INMB object

get_var_inmb():

Return the calculated hypothetical variance of the Incremental Net Monetary Benefit (INMB)

See Also

create_object_var_inmb_direct to directly provide a value for the variance of the Incremental Net Monetary Benefit

create_object_var_inmb_diff to calculate the theoretical standard deviation of the expected INB with different standard deviation in the reference and the experimental group

create_object_var_inmb the constructor

Examples

## First, create a lambda object
object_lambda <- create_object_lambda (20000)
## Then, create a var_inmb object
var_inmb <- create_object_var_inmb(sde=0.12, sdc=2100, rho=0.1, object_lambda=object_lambda)
var_inmb$get_var_inmb()

A Reference Class to represent the variance of the Incremental Net Monetary Benefit (INMB) when the standard deviation of costs and effectiveness in each group differ.

Description

The variance of the Incremental Net Monetary Benefit may also be calculated in a hypothetical situation when the standard deviation of costs and effectiveness in each group differ.

Fields

sdc_ref

: standard deviation of costs in the reference group

sdc_exp

: standard deviation of costs in the experimental group

sde_exp

: standard deviation of effectiveness in the experimental group

sde_ref

: standard deviation of effectiveness in the reference group

rho

: coefficient of correlation between the difference in costs (dc) and the difference in effectiveness (de)

object_lambda

: object containing the ceiling cost-effectiveness ratio or maximum acceptable cost of a unit of effectiveness. See create_object_lambda

See Also

create_object_var_inmb_direct to directly provide a value for the variance of the Incremental Net Monetary Benefit

create_object_var_inmb to calculate the theoretical standard deviation of the expected INB with the same standard deviation in the reference and the experimental group

create_object_var_inmb_diff the constructor

set_sdc_ref(sdc_ref):

sets the standard deviation of costs in the reference group of this VAR_INMB_DIFF object

set_sdc_exp(sdc_exp):

sets the standard deviation of costs in the experimental group of this VAR_INMB_DIFF object

set_sde_exp(sde_exp):

sets the standard deviation of effectiveness in the experimental group of this VAR_INMB_DIFF object

set_sde_ref(sde_ref):

sets the standard deviation of effectiveness in the reference group of this VAR_INMB_DIFF object

set_rho(rho):

Sets the coefficient of correlation between the difference in costs (dc) and the difference in effectiveness (de) of this VAR_INMB_DIFF object

set_lambda(lambda):

sets the lambda value of this VAR_INMB_DIFF object

get_var_inmb():

Return the calculated variance of the Incremental Net Monetary Benefit when the standard deviation of costs and effectiveness in each group differ.

Examples

## First, create a lambda object
object_lambda <- create_object_lambda (20000)
## Then, create a var_inmb_diff object
var_inmb_diff <- create_object_var_inmb_diff(sdc_ref=2100, sdc_exp=2100, sde_ref = 0.12,
sde_exp = 0.12, rho = 0.1,object_lambda = object_lambda)

A Reference Class to represent the theoretical standard deviation of the expected INB

Description

When absolutely no data regarding the variability of costs and effectiveness are available, it is possible to directly provide a value for the variance of the Incremental Net Monetary Benefit in this object.

Fields

var_inmb

: variance of the Incremental Net Monetary Benefit

Methods

set_var_inmb(inmb):

sets the var_inmb for this VAR_INMB_DIRECT object

See Also

create_object_var_inmb_diff to calculate the theoretical standard deviation of the expected INB with different standard deviation in the reference and the experimental group

create_object_var_inmb to calculate the theoretical standard deviation of the expected INB with the same standard deviation in the reference and the experimental group

create_object_var_inmb_direct the constructor

Examples

## Create a var_inmb object :
object_var_inmb <- create_object_var_inmb_direct(var_inmb = 18324000)
## retrieve the inmb value from the object
object_var_inmb$get_var_inmb()

Create an object evpi_decrease

Description

An object that combines three others objects : object_inmb, object_pop, object_var_inmb. It contains methods to compute the value of perfect information (EVPI) that would remain after a study of n participants (EVPIn). For each additional individual included, the EVPI decreases. So EVPIn is a decreasing vector. It is used to determine the optimal sample size.

Usage

create_object_evpi_decrease(
  object_inmb,
  object_pop,
  object_var_inmb,
  step_exp = 1,
  step_ref = 1
)

Arguments

object_inmb

An object that represents the INMB (Incremental Net Monetary Benefit) Create an object with one of these functions : create_object_inmb_direct, create_object_inmb

object_pop

An object that represents the size of the targeted population. Create an object with create_object_pop

object_var_inmb

An object that represents the variance of INMB. The variance of INMB can be directly hypothesized, or calculated through sdc, sde, rho and lambda, or calculated through sdc_ref, sde_ref, sdc_exp, sde_exp, rho and lambda. Create an object with one of these functions : create_object_var_inmb_direct, create_object_var_inmb,create_object_var_inmb_diff

step_exp

(default=1) : the minimal number of individuals to be included in the experimental group to respect the allocation ratio. If the allocation ratio is 2:1 in favor of the experimental group, step_exp=2 and step_ref=1.

step_ref

(default=1) : the minimal number of individuals to be included in the reference group to respect the allocation ratio. If the allocation ratio is 2:1 in favor of the reference group, step_ref=2 and step_exp=1.

Value

create_object_evpi_decrease returns an object of class EVPI_DECREASE

Examples

## First, create 3 objects : inmb, pop and var_inmb, then create the evpi_decrease object
object_lambda <- create_object_lambda (20000)
object_inmb <- create_object_inmb(de = 0.04, dc=-168, object_lambda = object_lambda)
object_var_inmb <- create_object_var_inmb(sde=0.12, sdc=2100, rho=0.1, object_lambda=object_lambda)
object_pop <- create_object_pop(horizon = 20, discount=0.04, N_year = 52000)
object_evpi_decrease <- create_object_evpi_decrease(object_inmb, object_pop, object_var_inmb)

Create an object INMB

Description

The net monetary benefit (NMB) of an intervention is given by E x Lambda - C, where E and C are the effectiveness and cost of this intervention, and Lambda is the threshold value for a unit of effectiveness, the ceiling incremental cost-effectiveness ratio. When the NMB is positive, the value of the intervention's effectiveness overpasses its cost. When evaluating the cost-effectiveness of a new intervention in comparison with the reference, one can estimate the difference between the net monetary benefit of the new or experimental intervention (NMBn) and the net monetary benefit of the reference (NMBr). This difference is known as the incremental net monetary benefit (INMB), which is given by: INMB = NMBn - NMBr = de x lambda - dc. The new intervention is cost-effective if INMB is positive.

Usage

create_object_inmb(de, dc, object_lambda)

Arguments

de

: Expected point estimate of the difference in mean effectiveness (effectiveness in the experimental group minus effectiveness in the reference group)

dc

: Expected point estimate of the difference in mean cost (cost in the experimental group minus cost in the reference group)

object_lambda

: object containing the ceiling cost-effectiveness ratio or maximum acceptable cost of a unit of effectiveness. See create_object_lambda

Value

create_object_inmb returns an object of class INMB which inherits from the class INMB_DIRECT

See Also

create_object_inmb_direct for INMB directly defined

Examples

## First, create a lambda object
object_lambda <- create_object_lambda (20000)
## Then, create an inmb object
object_inmb <- create_object_inmb(de = 0.04, dc=-168, object_lambda = object_lambda)
## inmb is calculated by methods inside the object. Retrieve the inmb :
object_inmb$get_inmb()

Create an object INMB_DIRECT

Description

If the INMB can be drawn from de, dc and lambda with create_object_inmb, one can also make directly an hypothesis on the value of the INMB.

Usage

create_object_inmb_direct(inmb)

Arguments

inmb

: expected Incremental Net Monetary Benefit

Value

create_object_inmb_direct returns an object of class INMB_DIRECT

See Also

create_object_inmb

Examples

## Create an object inmb_direct
object_inmb_direct <- create_object_inmb_direct (968)

Create an object lambda

Description

Lambda is known as the willingness to pay. That is the ceiling cost-effectiveness ratio or the maximum acceptable cost of a unit of effectiveness. It must be coherent with the criteria of effectiveness used in the analysis (year of life, QALY, life saved, or a criteria related to morbidity).

Usage

create_object_lambda(lambda)

Arguments

lambda

: Lambda is a monetary value. For example, the value of lambda is usually between 20 000 and 40 000 pounds/QALY in UK.

Value

create_object_lambda returns an object of class Lambda

Examples

## Create an object lambda
object_lambda <- create_object_lambda (20000)
## retrieve the lambda value from the object
object_lambda$get_lambda()

Create an object POP

Description

The expected value of perfect information (EVPI) is estimated for the entire population targeted by the evaluated intervention. This object represents this target population. The size of the target population (POP) can be estimated through prevalence and incidence data from registries, large cohort studies, medico-administrative databases, or surveillance systems. POP has to be calculated over the entire time horizon used for the estimation of the EVPI. It is usually easier to gather data on the annual number of individual susceptible to benefit for the new intervention. If this number is expected to be constant over the time horizon, POP is the product of this time horizon (in years) and the annual number of individual. If the time horizon is longer than one year, POP has to be discounted.

Usage

create_object_pop(horizon, discount, N_year)

Arguments

horizon

: Time horizon in years considered in the estimation of the EVPI. Finite time horizons are recommended in order to control for the complex and uncertain process of future changes. Furthermore, because of discounting, the impact of a time horizon over 15 or 20 years on the estimation of EVPI is insignificant.

discount

: Annual discount rate considered in the estimation of the EVPI. The annual discount rate is defined in each country, usually within 3 to 6%.

N_year

: Number of individuals likely to be targeted by the evaluated intervention each year

Value

create_object_pop returns an object of class POP

Examples

object_pop <- create_object_pop(horizon = 20, discount=0.04, N_year = 52000)

Create an object var_inmb

Description

Hypothetical variance of the Incremental Net Monetary Benefit. If data are available this variance can be calculated based of the common standard deviation of costs in each group (sdc), the common standard deviation of effectiveness in each group (sde), lambda (create_object_lambda), and the coefficient of correlation (rho) between the difference in costs (dc) and the difference in effectiveness (de)

Usage

create_object_var_inmb(sdc, sde, rho, object_lambda)

Arguments

sdc

: common standard deviation of costs in each group

sde

: common standard deviation of effectiveness in each group

rho

: coefficient of correlation between the difference in costs (dc) and the difference in effectiveness (de)

object_lambda

: an object lambda. Create one with create_object_lambda. It contains lambda : the ceiling cost-effectiveness ratio or maximum acceptable cost of a unit of effectiveness

Value

create_object_var_inmb returns an object of class VAR_INMB which inherits from the class VAR_INMB_DIRECT

See Also

create_object_var_inmb_direct to directly provide a value for the variance of the Incremental Net Monetary Benefit

create_object_var_inmb_diff to calculate the theoretical standard deviation of the expected INB with different standard deviation in the reference and the experimental group

Examples

## First, create a lambda object
object_lambda <- create_object_lambda (20000)
## Then, create a var_inmb object
var_inmb <- create_object_var_inmb(sde=0.12, sdc=2100, rho=0.1, object_lambda=object_lambda)
var_inmb$get_var_inmb()

Create an object var_inmb_diff

Description

The variance of the Incremental Net Monetary Benefit may also be calculated in a hypothetical situation when the standard deviation of costs and effectiveness in each group differ.

Usage

create_object_var_inmb_diff(
  sdc_ref,
  sdc_exp,
  sde_ref,
  sde_exp,
  rho,
  object_lambda
)

Arguments

sdc_ref

: standard deviation of costs in the reference group

sdc_exp

: standard deviation of costs in the experimental group

sde_ref

: standard deviation of effectiveness in the reference group

sde_exp

: standard deviation of effectiveness in the experimental group

rho

: coefficient of correlation between the difference in costs (dc) and the difference in effectiveness (de)

object_lambda

: object containing the ceiling cost-effectiveness ratio or maximum acceptable cost of a unit of effectiveness. See create_object_lambda

Value

create_object_var_inmb_diff returns an object of class VAR_INMB_DIFF which inherits from the class VAR_INMB_DIRECT

See Also

create_object_var_inmb_direct to directly provide a value for the variance of the Incremental Net Monetary Benefit

create_object_var_inmb to calculate the theoretical standard deviation of the expected INB with the same standard deviation in the reference and the experimental group

Examples

## First, create a lambda object
object_lambda <- create_object_lambda (20000)
## Then, create a var_inmb_diff object
var_inmb_diff <- create_object_var_inmb_diff(sdc_ref=2100, sdc_exp=2100, sde_ref = 0.12,
sde_exp = 0.12, rho = 0.1,object_lambda = object_lambda)

Create an object var_inmb_direct

Description

When absolutely no data regarding the variability of costs and effectiveness are available, it is possible to directly provide a value for the variance of the Incremental Net Monetary Benefit in this object.

Usage

create_object_var_inmb_direct(var_inmb)

Arguments

var_inmb

: variance of the Incremental Net Monetary Benefit

Value

create_object_var_inmb_direct returns an object of class VAR_INMB_DIRECT

See Also

create_object_var_inmb_diff to calculate the theoretical standard deviation of the expected INB with different standard deviation in the reference and the experimental group

create_object_var_inmb to calculate the theoretical standard deviation of the expected INB with the same standard deviation in the reference and the experimental group

Examples

## Create a var_inmb object :
object_var_inmb <- create_object_var_inmb_direct(var_inmb = 18324000)
## retrieve the inmb value from the object
object_var_inmb$get_var_inmb()

Function to estimate the gamma risk

Description

The gamma risk is the probability that a decision based on the expected mean of the Incremental Net Monetary Benefit (INMB) is wrong. In other terms, it is one minus the cost-effectiveness probability of an intervention. Use sample_size function first to estimate the sample size before calling this function.

Usage

gamma_risk(object_evpi_decrease)

Arguments

object_evpi_decrease

An evpi_decrease object. See create_object_evpi_decrease

Value

A numeric value representing the gamma risk (probability)


Plot to explain the estimated sample size calculation

Description

Displays a graph showing the estimated sample size based on the EVPI gain after the inclusion of new participants and the associated inclusion costs. Use sample_size first to estimate the sample size before calling this function.

Usage

graph_gain_n(object_evpi_decrease, cost_indiv)

Arguments

object_evpi_decrease

An evpi_decrease object. See create_object_evpi_decrease

cost_indiv

Mean costs induced by the inclusion and follow-up of one participant in the study

Value

'NULL', invisibly . Called for its plotting side effect.


Function to calculate the estimated sample size based on the Expected Value of Perfect Information (EVPI)

Description

This function calculates the optimal total sample size for a planned cost-effectiveness study. The optimal sample size is reached when the marginal EVPI gain is less than or equal to the marginal cost of inclusion: (step_ref + step_exp) * cost_indiv.

Usage

sample_size(object_evpi_decrease, cost_indiv)

Arguments

object_evpi_decrease

An evpi_decrease object. See create_object_evpi_decrease

cost_indiv

cost of an additional inclusion in your planned cost-effectiveness study.

Value

A dataframe containing three columns :

N

Total sample size of the planned cost-effectiveness study

N_exp

Sample size in the experimental group

N_ref

Sample size in the reference group