ff_inflation_adjust | R Documentation |
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
ff_inflation_adjust( data_frame, wages_col, se_col, year_col, year_adjust, errors = FALSE )
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 |
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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.