View source: R/io_rm_dynamics.R
io_rm_dynamics | R Documentation |
Remove dynamic consumption categories, e.g. inventory or gross-fixed-capital-formation from an input-output (IO) table by recalculating the IO table based on its leontief inverse and implied new demand.
io_rm_dynamics(iot, dynamic_categories, category_to_scale)
iot |
An input-output table in long format with the columns,
|
dynamic_categories |
a vector of dynamic categories in final use to be removed |
category_to_scale |
the use category (as integer) to which to add the positive components of removed categories. |
Static CGE trade models often can/do not capture dynamic components
such as changes in inventory or gross-fixed-capital-formation. Therefore
this function allows to recalculate the IO table following the suggestions
in Costinot and RodrÃguez-Clare (2014). Specifically, negative changes in
dynamic components of final consumption are assumed to have been produced
in the current period, and positive components are added to a different
category that can be specified using the category_to_scale
argument
(usually this will be final consumption by households). To account for the
intermediate goods that would have been necessary to produce the negative
components in the current period the approach relies on a leontief inverse
to calculate intermediate use based upon the implied new demand.
Returns an IO table in long format as a tibble
with the
columns origin
, sector
, destination
, use
and
flow
## Not run:
library(iotr)
# set cache_dir for WIOD to avoid long download times on every run !!!
cache_dir <- NULL
wiot_raw <- io_load_wiot(cache_dir, years = 2000:2014)
wiot_long <- io_tidy_wiot(wiot_raw)
# get wiot into standard long IO-table format
iot <- dplyr::filter(wiot_long, Country != "TOT", Year == "2014")
iot <-
dplyr::select(iot,
origin = Country,
sector = RNr,
destination,
use,
flow)
iot <- io_rm_negative_vad(iot, category_to_scale = 57)
iot <-
io_rm_dynamics(iot,
dynamic_categories = c(60, 61),
category_to_scale = 57)
iot <- io_gen_own_trade(iot, max_replace = 1e-6)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.