View source: R/gta trade coverage.R
gta_trade_coverage | R Documentation |
Computes the trade coverages of GTA measures.
gta_trade_coverage(
data.path = "data/master_plus.Rdata",
replica.path = "data/database replica/database replica - parts - base.Rdata",
replica.path.atl = "data/database replica/gta_affected_tariff_line.Rdata",
replica.path.tuple = "data/database replica/gta_tuple.Rdata",
coverage.period = NULL,
current.year.todate = TRUE,
gta.evaluation = NULL,
affected.flows = c("inward", "outward subsidy"),
importers = NULL,
keep.importers = NULL,
incl.importers.strictness = "ONEPLUS",
group.importers = TRUE,
separate.importer.groups = FALSE,
nr.importers = c(0, 999),
nr.importers.incl = "ALL",
jointly.affected.importers = FALSE,
exporters = NULL,
keep.exporters = NULL,
incl.exporters.strictness = "ONEPLUS",
group.exporters = TRUE,
separate.exporter.groups = FALSE,
nr.exporters = c(0, 999),
nr.exporters.incl = "ALL",
implementers = NULL,
implementer.role = NULL,
keep.implementer = TRUE,
group.implementers = TRUE,
separate.implementer.groups = FALSE,
implementer.trade = NULL,
announcement.period = NULL,
implementation.period = NULL,
revocation.period = NULL,
keep.revocation.na = NULL,
submission.period = NULL,
in.force.on.date = Sys.Date(),
keep.in.force.on.date = "any",
intervention.types = NULL,
keep.type = NULL,
keep.devaluations = FALSE,
group.type = TRUE,
mast.chapters = NULL,
keep.mast = NULL,
group.mast = TRUE,
implementation.level = NULL,
keep.level = NULL,
eligible.firms = NULL,
keep.firms = NULL,
keep.firm.trade.finance = FALSE,
keep.firm.financial.assistance.ifm = FALSE,
cpc.sectors = NULL,
keep.cpc = NULL,
hs.codes = NULL,
keep.hs = NULL,
hit.brackets = c(1, 99999),
intervention.ids = NULL,
keep.interventions = NULL,
lag.adjustment = NULL,
reporting.period = NULL,
add.unpublished = F,
intra.year.duration = TRUE,
get.hs.level.data = FALSE,
trade.statistic = "share",
trade.data = "base",
trade.data.path = "data/support tables/Goods support table for gtalibrary.Rdata",
rdata = FALSE,
xlsx = FALSE,
output.path = NULL,
xlsx.interventions = FALSE,
output.path.interventions = NULL
)
data.path |
Specifies where the GTA data file is located (Default: 'data/master_plus.Rdata'). Set to 'online' to download the latest copy. |
replica.path |
Location of the database replica. Default is 'data/database replica/database replica - parts - base.Rdata'. |
coverage.period |
The calendar years for which to calculate the trade coverage shares. Default is c(2009,CURRENT.YEAR). Calculation includes interventions based on enforcement status, not implementation date i.e. if you start in 2010, this function will also work with interventions implemneted in 2009 but still in force in 2010. Use implementation.period parameter to change this. |
current.year.todate |
Should the coverage statistics for the current year be calculated as 'coverage for year to date' (TRUE) or 'coverage for entire current year' (FALSE). Default is TRUE. |
gta.evaluation |
Specify what GTA evaluations to include. Default is 'any'. Permissible values are 'red', 'amber', 'green' or combinations thereof. |
affected.flows |
Specify the direction of the trade flow that is affected. The point of view is from the implementing country. Default is c('inward','outward subsidy'). Permissible values are 'inward', 'outward', 'outward subsidy' or combinations thereof. |
importers |
Takes in a list of country names, UN codes or country groups (g7, g20, eu28, ldc, au) to filter for importers in the sample. Default: All importers. |
keep.importers |
Specify whether to focus on ('TRUE') or exclude ('FALSE') the stated importers. |
incl.importers.strictness |
Specify whether to include interventions that affect only one of the selected importers ('ONE'), at least one of the selected importers ('ONEPLUS') or all of the selected importers ('ALL'). Default is 'ONEPLUS'. |
group.importers |
Specify whether to aggregate the statistics for all remaining importers into one group (TRUE) or whether create the statistics for every single one (FALSE). Default is TRUE. |
separate.importer.groups |
Specifiy whether to separately calculate groups in chosen importers ('TRUE') or not ('FALSE'). Default: FALSE. |
nr.importers |
Specify the range for the number of importers affected by an intervention. Default is any number i.e. c(1,999). |
nr.importers.incl |
Specify whether in the number of importers affected by an intervention is calculated based only on the selected importers are included ('SELECTED'), only on the unselected importers ('UNSELECTED') or based on both ('ALL'). Default is 'ALL'. |
exporters |
Takes in a list of country names, UN codes or country groups (g7, g20, eu28, ldc, au) to filter for exporters in the sample. Default: All exporters. |
keep.exporters |
Specify whether to focus on ('TRUE') or exclude ('FALSE') the stated exporters. |
incl.exporters.strictness |
Specify whether to include interventions that affect only one of the selected exporters ('ONE'), at least one of the selected exporters ('ONEPLUS') or all of the selected exporters ('ALL'). Default is 'ONEPLUS'. |
group.exporters |
Specify whether to aggregate the statistics for all remaining exporters into one group (TRUE) or whether create the statistics for every single one (FALSE). Default is TRUE. |
separate.exporter.groups |
Specifiy whether to separately calculate groups in chosen exporters ('TRUE') or not ('FALSE'). Default: FALSE. |
nr.exporters |
Specify the range for the number of exporters affected by an intervention. Default is any number i.e. c(1,999). |
nr.exporters.incl |
Specify whether in the number of exporters affected by an intervention is calculated based only on the selected exporters are included ('SELECTED'), only on the unselected exporters ('UNSELECTED') or based on both ('ALL'). Default is 'ALL'. |
implementers |
Takes in a list of country names, UN codes or country groups (g7, g20, eu28, ldc, au) to filter for implementers in the sample. Default: World (as in implemented by one). |
implementer.role |
Bilateral trade flows can be affected by multiple actors. Specify which actor's interventions you want to include. There are three roles: importer, exporter and 3rd country. Combinations are permissible. Default: c('importer','3rd country'). |
keep.implementer |
Specify whether to focus on ('TRUE') or exclude ('FALSE') interventions with the stated implementing country. |
group.implementers |
Specify whether to aggregate the statistics for all remaining implementers into one group (TRUE) or whether create the statistics for every single one (FALSE). Default is TRUE. |
separate.implementer.groups |
Specifiy whether to separately calculate groups in chosen implementers ('TRUE') or not ('FALSE'). Default: FALSE. |
implementer.trade |
Specify whether you want to receive import or export shares for the implementer. Default: As implied by selection in other fields. |
announcement.period |
Specify a period in which the announcements for your analysis have been made. Default is 'any'. Provide vectors c(after.date, before.date) in R's date format. Also, specify c(after.date, NA) to focus on interventions announced since 'after.date'. |
implementation.period |
Specify a period in which the interventions for your analysis have been implemented. Default is 'any' (incl. not implemented to date). Provide vectors c(after.date, before.date) in R's date format. Also, specify c(after.date, NA) to focus on interventions implemented since 'after.date'. |
revocation.period |
Specify a period in which the interventions for your analysis have been revoked. Default is 'any' (incl. not revoked). Provide vectors c(after.date, before.date) in R's date format. Also, specify c(after.date, NA) to focus on interventions revoked since 'after.date'. |
submission.period |
Specify a period in which the interventions for your analysis have been submitted. Default is 'any'. Provide vectors c(after.date, before.date) in R's date format. Also, specify c(after.date, NA) to focus on interventions revoked since 'after.date'. |
in.force.on.date |
Specify the cutoff date to control for in force interventions. Default is the current date (Sys.Date). |
keep.in.force.on.date |
Specify whether you want to focus on interventions in force on the specified date ('Yes') or no longer in force on the specified date ('No'). Default is 'any' i.e. regardless of enforcement status on the specified date. |
intervention.types |
Specify the names of the trade policy instruments for your analysis. Default is 'any'. For the permissible values, please see the GTA website or the GTA handbook. |
keep.type |
Specify whether to focus on ('TRUE') or exclude ('FALSE') interventions with the stated intervention type. |
keep.devaluations |
Specify whether to include "Competitive devaluation" into your calculations. Default is FALSE. |
group.type |
Specify whether to aggregate the statistics for all remaining intervention types into one group (TRUE) or whether create the statistics for every single type (FALSE). Default is TRUE. |
mast.chapters |
Specify the MAST chapter IDs for your analysis. Default is 'any'. Permissible values are the MAST chapter letters plus 'tariff', 'fdi', 'migration' and combinations thereof. |
keep.mast |
Specify whether to focus on ('TRUE') or exclude ('FALSE') interventions with the stated MAST chapter ID. |
group.mast |
Specify whether to aggregate the statistics for all remaining MAST chapters into one group (TRUE) or whether create the statistics for every single chapter (FALSE). Default is TRUE. |
implementation.level |
Specify the government level responsible for the intervention. Default is 'any'. Permissible values are 'supranational', 'national', 'subnational', 'IFI', 'NFI' or combinations thereof. IFI and NFI refer to government-owned financial institutions that are owned by one ('NFI') or more ('IFI') governments. |
keep.level |
Specify whether to focus on ('TRUE') or exclude ('FALSE') interventions with the stated implementation levels. |
eligible.firms |
Concentrate the analysis on interventions that are targeted at certain subsets. Default is 'any'. Permissible values are 'all', 'firm-specific', 'SMEs', 'state-controlled','state trading enterprise' or combinations thereof. |
keep.firms |
Specify whether to focus on ('TRUE') or exclude ('FALSE') interventions with the stated firm subsets. |
keep.firm.trade.finance |
Specify whether you want to keep firm-specific trade finance interventions inside the data set (Default: 'FALSE'). |
keep.firm.financial.assistance.ifm |
Specify whether you want to keep firm-specific 'financial assistance in a foreign market' interventions inside the data set (Default: 'FALSE'). |
cpc.sectors |
Provide a vector of CPC codes that you are interested in (version 2.1, 3-digit level). |
keep.cpc |
Specify whether to focus on ('TRUE') or exclude ('FALSE') interventions with the stated CPC codes. |
hs.codes |
Provide a vector of HS codes that you are interested in (2012 vintage, any digit level). |
keep.hs |
Specify whether to focus on ('TRUE') or exclude ('FALSE') interventions with the stated HS codes. |
hit.brackets |
Specify whether to calculate the trade shares by the number of interventions affecting a importer-exporter-product combination e.g. c(1,2,3,4,5,999999) for the brackets '1-2,3-4,5 or more'. Default is c(1,99999). |
intervention.ids |
Provide a vector of intervention IDs. |
keep.interventions |
Specify whether to focus on ('TRUE') or exclude ('FALSE') the stated intervention IDs. |
lag.adjustment |
Create a snapshot of the GTA data at the same point in each calendar year since 2009. Specify a cut-off date ('MM-DD'). |
reporting.period |
Specify the period in which an intervention was documented by the GTA team. Default c('2008-11-01',today). |
intra.year.duration |
Adjust the estimates for the number of days the relevant intervention has been in force in the given year (TRUE/FALSE). Default is TRUE. |
trade.statistic |
Choose to calculate trade shares ('share') or absolute USD values ('value'). Default is 'share'. |
trade.data |
Choose the trade data underlying these calulations. Choices are individual years between 2005 and 2020, the GTA base period data ('base', averages for 2005-2007) as well as moving trade data as a function of coverage year ('prior year' and 'current year'). Default is 'base'. |
trade.data.path |
Set path of trade data file (default is 'data/support tables/Goods support table for gtalibrary.Rdata'), |
rdata |
Takes value TRUE or FALSE. If TRUE, Rdata file will be stored alongside xlsx. Default: FALSE |
xlsx |
Takes value TRUE or FALSE. If TRUE, xlsx file will be stored. Default: FALSE |
output.path |
Takes the value of the output path (without the filename) added to the working directory as a string starting with "/". Default: None. |
xlsx.interventions |
Takes value TRUE or FALSE. If TRUE, xlsx file with a list of used interventions will be stored. Default: FALSE |
output.path.interventions |
Takes the value of the output path for the interventions list file (without the filename) added to the working directory as a string starting with "/". Default: None. |
Outputs a table with coverage shares ranging from 2009 to 2020 for each importer, exporter, implementer, instrument combination.
Global Trade Alert
www.globaltradealert.org
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.