ff_inflation_adjust: Inflation Adjustments

View source: R/adjustments.R

ff_inflation_adjustR Documentation

Inflation Adjustments

Description

This function converts dollar amounts to a given year's dollar amount. Reference for calculations: US Census Bureau, A Compass for Understanding and Using ACS Data, October 2008, A-22

Usage

ff_inflation_adjust(
  data_frame,
  wages_col,
  se_col,
  year_col,
  year_adjust,
  errors = FALSE
)

Arguments

data_frame

Name of dataframe that contains dollar amounts

wages_col

String representing the column name containing dollar amounts

se_col

String representing the column name containing dollar amounts. Value will be blank if 'errors = FALSE'.

year_col

String representing the column name containing years

year_adjust

Integer signifying the year to adjust dollar amounts to

errors

Boolean (TRUE / FALSE) signifying whether dataset contains standard errors that also need to be adjusted

Value

The same data frame that was given as input, but with 'wages_col' now representing inflation adjusted wages. If 'errors = TRUE', the standard error column will also signify the inflation adjusted standard errors.

Examples

df <- data.frame(year = seq(2008, 2017, 1),
                 wages = round( rnorm(10, 30000, 10000), 0),
                 se = round( rnorm(10, 1000, 100), 0))

ff_inflation_adjust(df, wages_col = 'wages', se_col = 'se', year_col = 'year',
                    year_adjust = 2017, errors = TRUE)


forsythfuture/FFtools documentation built on April 5, 2022, 10:02 p.m.