View source: R/balassa_index.R
balassa_index | R Documentation |
balassa_index()
computes the Balassa Index for a
bipartite relation between countries and products.
balassa_index(
data,
discrete = TRUE,
cutoff = 1,
country = "country",
product = "product",
value = "value"
)
data |
(Type: data.frame, matrix or dgCMatrix) a dataset such as
|
discrete |
(Type: logical) whether converting the Balassa Index to
discrete (0/1) values. Anything below the specified cutoff is converted to 0
and 1 otherwise. By default this is set to |
cutoff |
(Type: numeric) the cutoff to use for discretization.
By default this is set to |
country |
(Type: character) the column with the countries.
By default this is set to |
product |
(Type: character) the column with the products.
By default this is set to |
value |
(Type: character) the column with the metric for
country-product pairs.
By default this is set to |
The current implementation follows \insertCitemeasuringcomplexity2015economiccomplexity to obtain a metric for specialisation. In the context of international trade, if the Balassa Index for a country-product pair is more than 1, it means that country is specialized in that product. If the input for this function is a data.frame instead of a matrix, the function shall aggregate the data and convert the input to a matrix.
A matrix with the Balassa Index.
For more information see:
\insertRefmeasuringcomplexity2015economiccomplexity
and the references therein.
bi <- balassa_index(world_trade_avg_1998_to_2000)
# partial view of index
bi[1:5, 1:5]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.