get_sigma | R Documentation |
Returns product-level import demand price elasticities based on 3-digit HS0 estimates from Broda and Weinstein (QJE, 2006) for 73 countries.
get_sigma(
sourcevar,
origin,
country = "USA",
use_SITC = FALSE,
give_avg = TRUE
)
sourcevar |
An input character vector of industry/product codes. |
origin |
A string setting the input coding scheme. Supports the following classifications: "HS0" (1988/92), "HS1" (1996), "HS2" (2002), "HS3" (2007), "HS4" (2012), "HS5" (2017), "HS6" (2022), "HS" (combined), "SITC1" (1950), "SITC2" (1974), "SITC3" (1985), "SITC4" (2006), "NAICS2002", "NAICS2007", "NAICS2012", "NAICS2017", "ISIC2" (1968), "ISIC3" (1989), "ISIC3.1" (2002), "ISIC4" (2008), "BEC4" (2016). |
country |
A string setting the ISO 3-letter country code for which to return import demand elasticities (default = "USA"). For a list of available countries, load the package and type "unique(sigma_hs0_3d$iso3c)". |
use_SITC |
Set to FALSE by default. Set to TRUE if you wish to look up elasticities via 5-digit SITC3 codes instead. Only available for the United States. |
give_avg |
Set to FALSE if you wish to obtain the full vector of elasticities for all matching codes of each element in the input vector. When set to TRUE (as by default) each output element will be a simple average of all elasticities (of matched codes) in the corresponding vector. |
Concords vector of input codes to 3-digit HS0 codes and then extracts the corresponding product-level import demand elasticities in the country selected by the user. For the United States (only), Broda and Weinstein (2006) have also estimated elasticities based on more fine-grained 5-digit SITC3 codes. Set use_SITC
to TRUE to obtain elasticities in the United States via this method.
Always include leading zeros in codes (e.g., use HS code 010110 instead of 10110)—results may be buggy otherwise.
Data from David E. Weinstein's webpage <http://www.columbia.edu/~dew35/TradeElasticities/TradeElasticities.html>.
Broda, Christian, and David E. Weinstein. 2006. "Globalization and the Gains from Variety," Quarterly Journal of Economics, 121(2): 541–585.
# South Korea, SITC4 input
get_sigma(sourcevar = c("21170", "69978", "21170"), origin = "SITC4",
country = "KOR", use_SITC = FALSE, give_avg = TRUE)
get_sigma(sourcevar = c("21170", "69978", "21170"), origin = "SITC4",
country = "KOR", use_SITC = FALSE, give_avg = FALSE)
# United States, HS5 input, SITC3 estimates
get_sigma(sourcevar = c("0101", "0207", "0101"), origin = "HS5",
country = "USA", use_SITC = TRUE, give_avg = FALSE)
get_sigma(sourcevar = c("0101", "0207", "0101"), origin = "HS5",
country = "USA", use_SITC = TRUE, give_avg = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.