Skip to contents

Convert nominal wages (LCU at survey-year prices) into real wages expressed in 2021 PPP international dollars using: $$Real_{h}^{PPP} = (CPI_t / CPI_{2021}) * (Nominal_{h,t} / PPP_{2021})$$

Usage

convert_constant_ppp(data, cols)

Arguments

data

Data frame with columns (country_code, year, wage).

cols

A character vector with column name to convert to constant PPP in international 2021 dollars.

Value

`data_out` augmented with columns converted to international 2021 dollars.

Details

#' @details CPI data is sourced from [govhr::macro_indicators], which must contain columns country_code, year, and cpi.

Examples

library(tibble)
data <- tibble(
  country_code = c("BRA","BRA"),
  ref_date = c("2010-01-01", "2021-01-01"),
  wage = c(20000, 25000)
)

convert_constant_ppp(data, "wage")
#> # A tibble: 2 × 4
#>   country_code ref_date     wage   cpi
#>   <chr>        <chr>       <dbl> <dbl>
#> 1 BRA          2010-01-01  4363.  100 
#> 2 BRA          2021-01-01 10205.  187.