present_value: Present value of life years gained in the future

Description Usage Arguments Value Examples

View source: R/present_value.R

Description

Present value of life years gained in the future

Usage

1
present_value(life_years, vly, discount_rate = 0.03)

Arguments

life_years

A numeric vector of life years gained by year

vly

The value of a statistical life year

discount_rate

The discount rate to be applied

Value

A numeric vector of the present value of life years gained in future years.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
population <- subset(single_year_data,
                     time == 2011 & sex == "Persons" & measure == "Population")
population <- population[, c("age", "value")]
population$age <- as.numeric(gsub(" .+", "", population$age))
colnames(population)[2] <- "population"
deaths <- subset(single_year_data,
                 time == 2011 & sex == "Persons"& measure == "Deaths")
deaths <- deaths[, "value"]
demog_data <- data.frame(population, deaths = deaths)

no_lag <- impact(demog_data)
ly_extended <- colSums(no_lag$ly_extended)

sum(present_value(ly_extended, 250000))

richardbroome2002/iomlifetR documentation built on Aug. 19, 2019, 10:26 p.m.