get_dynfields: Helper function to get a tibble of the relevant fields from...

View source: R/extract.R

get_dynfieldsR Documentation

Helper function to get a tibble of the relevant fields from heemod output

Description

Helper function to get a tibble of the relevant fields from heemod output

Usage

get_dynfields(heemodel, payoffs, discount, fname = NA)

Arguments

heemodel

A health economic model object from the heemod package (see heemod::heemod-package).

payoffs

Field names of payoffs of interest (string vector)

discount

Name of parameter providing discount rate per cycle (string)

fname

Export data to a .CSV file of this name, if given (character)

Value

Tibble of payoffs taken from the heemod model, by intervention and model timestep (model_time).

The field vt is calculated as (1+i)^(1-model_time), where i is the discount rate per model timestep set in the heemod model through the parameter disc_cycle. This can be useful in 'rolling-up' payoff values to the timestep in which they were incurred.

An additional set of payoffs (identified with a "_rup" suffix) provides calculations of the payoffs as at the start of the timestep in which they were incurred, i.e. original payoff / vt.

See Also

heemod::heemod-package

Examples

democe <- get_dynfields(
   heemodel = oncpsm,
   payoffs = c("cost_daq_new", "cost_total", "qaly"),
   discount = "disc"
   )
head(democe)

dynamicpv documentation built on Jan. 16, 2026, 1:07 a.m.