currency.convert: Convert dollar values of acs object to a new base year.

Description Usage Arguments Details Value Author(s) See Also Examples

Description

currency.convert provides a helper function to create a new copy of an acs-class object with a modified currency.year and converted dollar values without altering the original object.

Usage

1
currency.convert(object, rate="auto", newyear=NA_integer_, verbose=F)

Arguments

object

an acs object

rate

an optional rate to apply; "auto" (the default) will look up values from the cpi dataset.

newyear

an integer specifying the new value of currency.year to convert into

verbose

whether to print additional information about the conversion

Details

currency.convert provides a helper function to create a new copy of an acs-class object with a modified currency.year and converted dollar values without altering the original object. When rate="auto" (the default), currency.convert will look up values from the cpi database to use in conversion. When a numeric rate is provided through this option, actual cpi values are ignored. When verbose=T, currency.convert will provide additional information about the rates of conversion and the acs.colnames converted.

As of version 2.0 the package includes CPI data from 1913 through 2015, allowing conversion of dollar values for any years in this range.

Value

Returns a new acs object with updated dollar values and currency.year metadata.

Unlike currency.year<-, currency.convert does not alter the original object.

Author(s)

Ezra Haber Glenn eglenn@mit.edu

See Also

currency.year

cpi

Examples

1
2
3
lawrence10                                   # median income data, endyear = 2010
currency.convert(lawrence10, newyear=2014)   # convert $$ to 2014 dollars 
currency.convert(lawrence10, newyear=1929)   # convert $$ to 1929 dollars

Example output

Loading required package: stringr
Loading required package: XML

Attaching package:acsThe following object is masked frompackage:base:

    apply

ACS DATA: 
 2006 -- 2010 ;
  Estimates w/90% confidence intervals;
  for different intervals, see confint()
                               Median.HH.Income
Census Tract 2501, Lawrence MA 13545 +/- 2129  
Census Tract 2502, Lawrence MA 45426 +/- 10498 
Census Tract 2503, Lawrence MA 32209 +/- 27310 
Census Tract 2504, Lawrence MA 22761 +/- 5803  
Census Tract 2505, Lawrence MA 40869 +/- 8395  
Census Tract 2506, Lawrence MA 45787 +/- 14834 
Census Tract 2507, Lawrence MA 28815 +/- 5061  
Census Tract 2508, Lawrence MA 40355 +/- 11003 
Census Tract 2509, Lawrence MA 25679 +/- 8786  
Census Tract 2510, Lawrence MA 21902 +/- 7907  
Census Tract 2511, Lawrence MA 15059 +/- 1839  
Census Tract 2512, Lawrence MA 19406 +/- 11073 
Census Tract 2513, Lawrence MA 15394 +/- 4692  
Census Tract 2514, Lawrence MA 40909 +/- 11594 
Census Tract 2515, Lawrence MA 38221 +/- 8434  
Census Tract 2516, Lawrence MA 29750 +/- 7878  
Census Tract 2517, Lawrence MA 46233 +/- 10167 
Census Tract 2518, Lawrence MA 54845 +/- 6095  
ACS DATA: 
 2006 -- 2010 ;
  Estimates w/90% confidence intervals;
  for different intervals, see confint()
                               Median.HH.Income                     
Census Tract 2501, Lawrence MA 14705.3468833694 +/- 2311.38305756319
Census Tract 2502, Lawrence MA 49317.466779176 +/- 11397.3223759034 
Census Tract 2503, Lawrence MA 34968.2183659243 +/- 29649.5403015739
Census Tract 2504, Lawrence MA 24710.8453608247 +/- 6300.12018930917
Census Tract 2505, Lawrence MA 44370.0865098874 +/- 9114.16663609348
Census Tract 2506, Lawrence MA 49709.392229519 +/- 16104.7704442895 
Census Tract 2507, Lawrence MA 31283.4677330594 +/- 5494.55596727446
Census Tract 2508, Lawrence MA 43812.0541512272 +/- 11945.5837399567
Census Tract 2509, Lawrence MA 27878.818945592 +/- 9538.66206845948 
Census Tract 2510, Lawrence MA 23778.2582089005 +/- 8584.36159518656
Census Tract 2511, Lawrence MA 16349.0453094618 +/- 1996.53989800785
Census Tract 2512, Lawrence MA 21068.4357045896 +/- 12021.580364677 
Census Tract 2513, Lawrence MA 16712.7434420516 +/- 5093.94518839197
Census Tract 2514, Lawrence MA 44413.5131525847 +/- 12587.2123858091
Census Tract 2515, Lawrence MA 41495.2427633268 +/- 9156.50761272334
Census Tract 2516, Lawrence MA 32298.5655061085 +/- 8552.87727923102
Census Tract 2517, Lawrence MA 50193.5992955938 +/- 11037.9669075834
Census Tract 2518, Lawrence MA 59543.3554683201 +/- 6617.13468099938
ACS DATA: 
 2006 -- 2010 ;
  Estimates w/90% confidence intervals;
  for different intervals, see confint()
                               Median.HH.Income                     
Census Tract 2501, Lawrence MA 1062.20191143559 +/- 166.956653336758
Census Tract 2502, Lawrence MA 3562.31701948123 +/- 823.255494001541
Census Tract 2503, Lawrence MA 2525.83694096929 +/- 2141.65627178339
Census Tract 2504, Lawrence MA 1784.92268041237 +/- 455.072550170598
Census Tract 2505, Lawrence MA 3204.95606633158 +/- 658.337766445317
Census Tract 2506, Lawrence MA 3590.62671974172 +/- 1163.28557801666
Census Tract 2507, Lawrence MA 2259.67870638735 +/- 396.884745203067
Census Tract 2508, Lawrence MA 3164.64807205488 +/- 862.857706277286
Census Tract 2509, Lawrence MA 2013.75288916609 +/- 689.000073375647
Census Tract 2510, Lawrence MA 1717.55970943244 +/- 620.068697949151
Census Tract 2511, Lawrence MA 1180.9301280405 +/- 144.214788861577 
Census Tract 2512, Lawrence MA 1521.82283450123 +/- 868.347121840261
Census Tract 2513, Lawrence MA 1207.20090252045 +/- 367.947683163958
Census Tract 2514, Lawrence MA 3208.09287522471 +/- 909.204057673258
Census Tract 2515, Lawrence MA 2997.29931760649 +/- 661.396155116117
Census Tract 2516, Lawrence MA 2333.00161426423 +/- 617.794511501633
Census Tract 2517, Lawrence MA 3625.6021389001 +/- 797.298400410904 
Census Tract 2518, Lawrence MA 4300.95709359064 +/- 477.971255090435

acs documentation built on May 1, 2019, 8:41 p.m.