diff --git a/DESCRIPTION b/DESCRIPTION index 0fc8ceb..7597461 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,19 +1,19 @@ -Package: RKS +Package: ReKS Type: Package Title: Regional Knowledge Space -Version: 0.2.6 +Version: 0.2.9 Authors@R: person("Carlo", "Bottai", email = "carlo.bottai@unito.it", role = c("aut", "cre")) Maintainer: Carlo Bottai -Description: By the moment RKS ("rocks") provides four nice functions. +Description: By the moment ReKS (``rex'') provides four functions. The first computes the entropy of a given array and implement an algoritm able to decompose it into between and within group entropy - (aka unrelated and related variety). The second calculates the - Coherence Index. The third and the fourth yield the ECI and the - Fitness/Complexity, respectively. In the future how knows?! -URL: https://github.com/n3ssuno/RKS -BugReports: https://github.com/n3ssuno/RKS/issues + (aka Unrelated and Related Variety, respectively). The second calculates + the Coherence Index. The third and the fourth yield the ECI and the + Fitness of a region, respectively. +URL: https://github.com/n3ssuno/ReKS +BugReports: https://github.com/n3ssuno/ReKS/issues License: GPL-3 + file LICENSE Encoding: UTF-8 RoxygenNote: 6.0.1 diff --git a/NAMESPACE b/NAMESPACE index 81087e4..276b8de 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,6 @@ exportPattern("^[^\\.]") # exportPattern("^[[:alpha:]]+") +S3method(plot, rks_biadj_matrix) + importFrom("stats", "complete.cases", "formula", "cor", "quantile") importFrom("graphics", "plot", "image", "box") diff --git a/R/ReKS.R b/R/ReKS.R new file mode 100644 index 0000000..20408e1 --- /dev/null +++ b/R/ReKS.R @@ -0,0 +1,17 @@ +#' ReKS: A package for computating some measure about the knowledge space +#' of a economic region. +#' +#' @section ReKS functions: +#' \itemize{ +#' \item{\code{\link{entropy}}} +#' \item{\code{\link{entropy_decomposition}}} +#' \item{\code{\link{entropy_decomposition_panel}}} +#' \item{\code{\link{coherence}}} +#' \item{\code{\link{coherence_panel}}} +#' \item{\code{\link{complexity}}} +#' \item{\code{\link{fitness}}} +#' } +#' +#' @docType package +#' @name ReKS +NULL diff --git a/R/coherence.R b/R/coherence.R index 7eaad59..0a4e131 100644 --- a/R/coherence.R +++ b/R/coherence.R @@ -15,21 +15,32 @@ #' You can use it both on a panel data set (if you identify also a column with #' a temporal indication of the observations) or on cross-section data (by #' leaveing the parameter just said as NULL). -#' See: -#' \itemize{ -#' \item{Teece, Rumelt, Dosi and Winter (1994) 'Understanding Corporate -#' Coherence: Theory and Evidence', \emph{Journal of Economic Behavior \& -#' Organization}, 23, 1-30;} -#' \item{Nesta and Saviotti (2005) 'Coherence of the Knowledge Base and the +#' +#' @references +#' Teece, Rumelt, Dosi and Winter (1994) ``Understanding Corporate +#' Coherence: Theory and Evidence'', \emph{Journal of Economic Behavior & +#' Organization}, 23, 1-30; +#' +#' Nesta and Saviotti (2005) ``Coherence of the Knowledge Base and the #' Firm's Innovative Performance: Evidence from the U.S. Pharmaceutical -#' Industry', \emph{Journal of Industrial Economics}, 53, 123-142;} -#' \item{Nesta and Saviotti (2006) 'Firm Knowledge and Market Value in -#' Biotechnology', \emph{Industrial and Corporate Change}, 15, 625-652;} -#' \item{Quatraro (2010) 'Knowledge Coherence, Variety and Economic Growth: -#' Manufacturing Evidence from Italian Regions', \emph{Research Policy}, 39, -#' 1289-1302.} +#' Industry'', \emph{Journal of Industrial Economics}, 53, 123-142; +#' +#' Nesta and Saviotti (2006) ``Firm Knowledge and Market Value in +#' Biotechnology'', \emph{Industrial and Corporate Change}, 15, 625-652; +#' +#' Bottazzi and Pirino (2010) ``Measuring Industry Relatedness and +#' Corporate Coherence'', \emph{SSRN Electronic Journal}, 11, 1--24; +#' +#' Quatraro (2010) ``Knowledge Coherence, Variety and Economic Growth: +#' Manufacturing Evidence from Italian Regions'', \emph{Research Policy}, 39, +#' 1289-1302; +#' +#' Rocchetta and Mina (2017), ``Technological Coherence and the Adaptive +#' Resilience of Regional Economies'', \emph{Papers in Evolutionary Economic +#' Geography}, Utrecht University. +#' +#' @encoding UTF-8 #' -#' } #' @param data It is expected to be a dataframe in "long" format. #' @param geo_dim It is the name of the column of the data.frame that #' represents its geographical dimension (e.g., the different regions of @@ -47,6 +58,7 @@ #' name of the columns above said as strings, otherwise they are assumed to #' be symbols. Default is FALSE. #' @return A data.frame with the Coherence Index of each geographical area. +#' #' @examples #' RCI <- coherence(data = df, geo_dim = NUTS2, #' kng_dim = IPC.3dig, kng_nbr = N.patents) diff --git a/R/coherence_panel.R b/R/coherence_panel.R index 59dc863..9e11e42 100644 --- a/R/coherence_panel.R +++ b/R/coherence_panel.R @@ -15,21 +15,32 @@ #' You can use it both on a panel data set (if you identify also a column with #' a temporal indication of the observations) or on cross-section data (by #' leaveing the parameter just said as NULL). -#' See: -#' \itemize{ -#' \item{Teece, Rumelt, Dosi and Winter (1994) 'Understanding Corporate -#' Coherence: Theory and Evidence', \emph{Journal of Economic Behavior \& -#' Organization}, 23, 1-30;} -#' \item{Nesta and Saviotti (2005) 'Coherence of the Knowledge Base and the -#' Firm's Innovative Performance: Evidence from the U.S. Pharmaceutical -#' Industry', \emph{Journal of Industrial Economics}, 53, 123-142;} -#' \item{Nesta and Saviotti (2006) 'Firm Knowledge and Market Value in -#' Biotechnology', \emph{Industrial and Corporate Change}, 15, 625-652;} -#' \item{Quatraro (2010) 'Knowledge Coherence, Variety and Economic Growth: +#' +#' @references +#' Teece, Rumelt, Dosi and Winter (1994) ``Understanding Corporate +#' Coherence: Theory and Evidence'', \emph{Journal of Economic Behavior & +#' Organization}, 23, 1--30; +#' +#' Nesta and Saviotti (2005) ``Coherence of the Knowledge Base and the +#' Firm's Innovative Performance: Evidence from the U.S. Pharmaceutical +#' Industry'', \emph{Journal of Industrial Economics}, 53, 123-142; +#' +#' Nesta and Saviotti (2006) 'Firm Knowledge and Market Value in +#' Biotechnology', \emph{Industrial and Corporate Change}, 15, 625-652; +#' +#' Bottazzi and Pirino (2010) ``Measuring Industry Relatedness and +#' Corporate Coherence'', \emph{SSRN Electronic Journal}, 11, 1--24; +#' +#' Quatraro (2010) 'Knowledge Coherence, Variety and Economic Growth: #' Manufacturing Evidence from Italian Regions', \emph{Research Policy}, 39, -#' 1289-1302.} +#' 1289-1302; +#' +#' Rocchetta and Mina (2017), ``Technological Coherence and the Adaptive +#' Resilience of Regional Economies'', \emph{Papers in Evolutionary Economic +#' Geography}, Utrecht University. +#' +#' @encoding UTF-8 #' -#' } #' @param data It is expected to be a dataframe in "long" format. #' @param geo_dim It is the name of the column of the data.frame that #' represents its geographical dimension (e.g., the different regions of diff --git a/R/complexity.R b/R/complexity.R index c1d48f4..f01dd30 100644 --- a/R/complexity.R +++ b/R/complexity.R @@ -5,21 +5,26 @@ #' Regional Knowledge Complexity Index #' #' @description +#' The function computes the ``Technological Complexity'' of each geographical +#' area considered, in each given year, in line with the so called \emph{Method +#' of Reflections} (see the references below). #' -#' @details +#' @references +#' Hidalgo, Klinger, Barabási and Hausmann (2007) ``The Product Space +#' Conditions the Development of Nations'', \emph{Science}, 317, 482--487; #' -#' See: -#' \itemize{ -#' \item{Hidalgo, Klinger, Barab{\'a}si and Hausmann (2007) "The Product Space -#' Conditions the Development of Nations", \emph{Science}, 317, 482--487;} -#' \item{Hidalgo and Hausmann (2009) "The Building Blocks of Economic -#' Complexity", \emph{PNAS}, 106, 10570--10575;} -#' \item{Antonelli, Crespi, Mongeau Ospina and Scellato (2017) "Knowledge +#' Hidalgo and Hausmann (2009) ``The Building Blocks of Economic +#' Complexity'', \emph{PNAS}, 106, 10570--10575; +#' +#' Antonelli, Crespi, Mongeau Ospina and Scellato (2017) ``Knowledge #' Composition, Jacobs Externalities and Innovation Performance in European -#' Regions", \emph{Regional Studies}, 51, 1708--1720;} -#' \item{Balland and Rigby (2017) "The Geography of Complex Knowledge", -#' \emph{Economic Geography}, 93, 1--23.} -#' } +#' Regions'', \emph{Regional Studies}, 51, 1708--1720; +#' +#' Balland and Rigby (2017) ``The Geography of Complex Knowledge'', +#' \emph{Economic Geography}, 93, 1--23. +#' +#' @encoding UTF-8 +#' #' @param data It is expected to be a dataframe in "long" format. #' @param geo_dim It is the name of the column of the data.frame that #' represents its geographical dimension (e.g., the different regions of diff --git a/R/entropy.R b/R/entropy.R index 1c1a286..19bb17b 100644 --- a/R/entropy.R +++ b/R/entropy.R @@ -13,16 +13,20 @@ #' that reports the absolute frequency of each of the possible types/groups of #' observations of the database. #' It is also used internally by the entropy decomposition functions. -#' See: -#' \itemize{ -#' \item{Shannon (1948) "A Mathematical Theory of Communication", \emph{Bell -#' System Technical Journal}, 27, 379--423;} -#' \item{Theil (1967) \emph{Economics and Information Theory}, North-Holland;} -#' \item{Theil (1972) \emph{Statistical Decomposition Analysis}, North-Holland;} -#' \item{Frenken (2007) "Entropy statistics and information theory", in +#' +#' @references +#' Shannon (1948) ``A Mathematical Theory of Communication'', \emph{Bell +#' System Technical Journal}, 27, 379--423; +#' +#' Theil (1967) \emph{Economics and Information Theory}, North-Holland; +#' +#' Theil (1972) \emph{Statistical Decomposition Analysis}, North-Holland; +#' +#' Frenken (2007) ``Entropy Statistics and Information Theory'', in #' Hanusch and Pyka (Eds.) \emph{Elgar Companion to Neo-Schumpeterian -#' Economics}, Edward Elgar.} -#' } +#' Economics}, Edward Elgar. +#' +#' @encoding UTF-8 #' #' @param data Numerical vector whos elements are the numerosity of each #' of the types in which the observations can be categorised (absolute diff --git a/R/entropy_decomposition.R b/R/entropy_decomposition.R index 4b67c74..289e6e8 100644 --- a/R/entropy_decomposition.R +++ b/R/entropy_decomposition.R @@ -14,27 +14,34 @@ #' decomposed components. The within-groups component is equal to the weighted #' average of the entropy of each of the groups. So the between-groups component #' is equal to the residual entropy. -#' See: -#' \itemize{ -#' \item{Theil (1972) \emph{Statistical Decomposition Analysis}, North-Holland;} -#' \item{Zadjenweber (1972) "Une Application de la Th{\'e}orie de l’Information -#' {\`a} l'{\'E}conomie: La Mesure de la Concentration, \emph{Revue d'Economie -#' Politique}, 82, 486–-510;} -#' \item{Attaran (1985) "Industrial Diversity and Economic Performance in U.S. -#' Areas, \emph{The Annals of Regional Science}, 20, 44--54;} -#' \item{Frenken (2007) "Entropy statistics and information theory", in +#' +#' @references +#' Theil (1972) \emph{Statistical Decomposition Analysis}, North-Holland; +#' +#' Zadjenweber (1972) ``Une Application de la Théorie de l'Information +#' à l'Économie: La Mesure de la Concentration'', \emph{Revue d'Economie +#' Politique}, 82, 486--510; +#' +#' Attaran (1985) ``Industrial Diversity and Economic Performance in U.S. +#' Areas'', \emph{The Annals of Regional Science}, 20, 44--54; +#' +#' Frenken (2007) ``Entropy Statistics and Information Theory'', in #' Hanusch and Pyka (Eds.) \emph{Elgar Companion to Neo-Schumpeterian -#' Economics}, Edward Elgar.} -#' \item{Frenken, van Oort and Verburg (2007) "Related Variety, Unrelated -#' Variety and Regional Economic Growth", \emph{Regional Studies}, 41, -#' 685--697;} -#' \item{Quatraro (2010) 'Knowledge Coherence, Variety and Economic Growth: -#' Manufacturing Evidence from Italian Regions', \emph{Research Policy}, 39, -#' 1289--1302;} -#' \item{Rocchetta and Mina (2017), "Technological Coherence and the Adaptive -#' Resilience of Regional Economies", \emph{Papers in Evolutionary Economic -#' Geography}, Utrecht University.} -#' } +#' Economics}, Edward Elgar; +#' +#' Frenken, van Oort and Verburg (2007) ``Related Variety, Unrelated +#' Variety and Regional Economic Growth'', \emph{Regional Studies}, 41, +#' 685--697; +#' +#' Quatraro (2010) ``Knowledge Coherence, Variety and Economic Growth: +#' Manufacturing Evidence from Italian Regions'', \emph{Research Policy}, 39, +#' 1289--1302; +#' +#' Rocchetta and Mina (2017), ``Technological Coherence and the Adaptive +#' Resilience of Regional Economies'', \emph{Papers in Evolutionary Economic +#' Geography}, Utrecht University. +#' +#' @encoding UTF-8 #' #' @param data Vector of elements. #' @param groups Vector that describes how the elements in the data can be diff --git a/R/entropy_decomposition_panel.R b/R/entropy_decomposition_panel.R index bf06e47..5380c47 100644 --- a/R/entropy_decomposition_panel.R +++ b/R/entropy_decomposition_panel.R @@ -17,27 +17,34 @@ #' and within-groups information entropy is provided. Internally the function #' computes and temorarily stores also other values. However they are not #' provided in the oputput dataframe. -#' See: -#' \itemize{ -#' \item{Theil (1972) \emph{Statistical Decomposition Analysis}, North-Holland;} -#' \item{Zadjenweber (1972) "Une Application de la Th{\'e}orie de l’Information -#' {\`a} l'{\'E}conomie: La Mesure de la Concentration, \emph{Revue d'Economie -#' Politique}, 82, 486–-510;} -#' \item{Attaran (1985) "Industrial Diversity and Economic Performance in U.S. -#' Areas, \emph{The Annals of Regional Science}, 20, 44--54;} -#' \item{Frenken (2007) "Entropy statistics and information theory", in +#' +#' @references +#' Theil (1972) \emph{Statistical Decomposition Analysis}, North-Holland; +#' +#' Zadjenweber (1972) ``Une Application de la Théorie de l'Information +#' à l'Économie: La Mesure de la Concentration'', \emph{Revue d'Economie +#' Politique}, 82, 486--510; +#' +#' Attaran (1985) ``Industrial Diversity and Economic Performance in U.S. +#' Areas'', \emph{The Annals of Regional Science}, 20, 44--54; +#' +#' Frenken (2007) ``Entropy Statistics and Information Theory'', in #' Hanusch and Pyka (Eds.) \emph{Elgar Companion to Neo-Schumpeterian -#' Economics}, Edward Elgar.} -#' \item{Frenken, van Oort and Verburg (2007) "Related Variety, Unrelated -#' Variety and Regional Economic Growth", \emph{Regional Studies}, 41, -#' 685--697;} -#' \item{Quatraro (2010) 'Knowledge Coherence, Variety and Economic Growth: -#' Manufacturing Evidence from Italian Regions', \emph{Research Policy}, 39, -#' 1289--1302;} -#' \item{Rocchetta and Mina (2017), "Technological Coherence and the Adaptive -#' Resilience of Regional Economies", \emph{Papers in Evolutionary Economic -#' Geography}, Utrecht University.} -#' } +#' Economics}, Edward Elgar; +#' +#' Frenken, van Oort and Verburg (2007) ``Related Variety, Unrelated +#' Variety and Regional Economic Growth'', \emph{Regional Studies}, 41, +#' 685--697; +#' +#' Quatraro (2010) ``Knowledge Coherence, Variety and Economic Growth: +#' Manufacturing Evidence from Italian Regions'', \emph{Research Policy}, 39, +#' 1289--1302; +#' +#' Rocchetta and Mina (2017), ``Technological Coherence and the Adaptive +#' Resilience of Regional Economies'', \emph{Papers in Evolutionary Economic +#' Geography}, Utrecht University. +#' +#' @encoding UTF-8 #' #' @param data It is expected to be a dataframe in "long" format. #' @param kng_nbr It is expected to be the name of the (numeric) column of the diff --git a/R/fitness.R b/R/fitness.R index c76b6d8..8c2b692 100644 --- a/R/fitness.R +++ b/R/fitness.R @@ -5,24 +5,26 @@ #' Regional Knowledge Fitness Index #' #' @description +#' The function computes the Fitness (i.e. \emph{competitiveness}) of each given +#' geographical area considered, in each year provided (see the references +#' below for further details). #' -#' @details +#' @references +#' Tacchella, Cristelli, Caldarelli, Gabrielli and Pietronero (2012) +#' ``A New Metrics for Countries' Fitness and Products' Complexity'', +#' \emph{Scientific Reports}, 2, 1--7; +#' +#' Tacchella, Cristelli, Caldarelli, Gabrielli and Pietronero (2013) +#' ``Economic Complexity: Conceptual Grounding of a New Metrics for Global +#' Competitiveness'', \emph{Journal of Economic Dynamics and Control}, 37, +#' 1683--1691; +#' +#' Cristelli, Gabrielli, Tacchella, Caldarelli and Pietronero (2013) +#' ``Measuring the Intangibles: A Metrics for the Economic Complexity of +#' Countries and Products'', \emph{PLOS ONE}, 8, e70726; +#' +#' @encoding UTF-8 #' -#' See: -#' \itemize{ -#' \item{Tacchella, Cristelli, Caldarelli, Gabrielli and Pietronero (2012) -#' "A New Metrics for Countries' Fitness and Products' Complexity", -#' \emph{Scientific Reports}, 2, 1--7;} -#' \item{Tacchella, Cristelli, Caldarelli, Gabrielli and Pietronero (2013) -#' "Economic Complexity: Conceptual Grounding of a New Metrics for Global -#' Competitiveness", \emph{Journal of Economic Dynamics and Control}, 37, -#' 1683--1691;} -#' \item{Cristelli, Gabrielli, Tacchella, Caldarelli and Pietronero (2013) -#' "Measuring the Intangibles: A Metrics for the Economic Complexity of -#' Countries and Products", \emph{PLOS ONE}, 8, e70726;} -#' \item{Balland and Rigby (2017) "The Geography of Complex Knowledge", -#' \emph{Economic Geography}, 93, 1--23.} -#' } #' @param data It is expected to be a dataframe in "long" format. #' @param geo_dim It is the name of the column of the data.frame that #' represents its geographical dimension (e.g., the different regions of diff --git a/R/plot_biadj_matrix.R b/R/plot_biadj_matrix.R index e77b749..ed6fee8 100644 --- a/R/plot_biadj_matrix.R +++ b/R/plot_biadj_matrix.R @@ -1,4 +1,38 @@ -# https://www.r-bloggers.com/creating-an-image-of-a-matrix-in-r-using-image/ +#' @name +#' plot_biadj_matrix +#' +#' @title +#' Plot a biadjacency matrix +#' +#' @description +#' The function plots a biadjacency matrix. +#' +#' @details +#' The function transforms the ``long'' table provided in a biadjacency matrix +#' and than plot it. +#' +#' @encoding UTF-8 +#' +#' @param data It must be a ``long'' dataframe. +#' @param geo_dim It must be a symbolic variable that denotes the name of the +#' column of the dataframe that represents the geographical units of analysis. +#' @param kng_dim It must be a symbolic variable that denotes the name of the +#' column of the dataframe that represents the technological knowledge units of +#' analysis. +#' @param kng_nbr It must be a symbolic variable that denotes the name of the +#' column of the dataframe that represents the number of technological units +#' of a given type that a given geographical units owns. +#' @param binary_mode It must be a string that represents the way in which the +#' data are transformed from count values to binary values. It can be 'none', +#' 'simple', 'RTA', 'RCA', 'higher_quartiles', 'higher_quartiles_kng', +#' 'higher_deciles_kng'. +#' @param order It must be a string that represents the way in which the matrix +#' rows and columns are re-arranged. By now the only possible option is "DU" that arranges the rows +#' and columns in order inverse to their degree (i.e., to the +#' \emph{diversification} of the geographical area and the \emph{ubiquity} of +#' the knowledge dimension considered.) +#' @param ... Other parameters taken by plot. +#' @return Nothing plot_biadj_matrix <- function(data, geo_dim, kng_dim, kng_nbr, binary_mode, order = "DU", ...) { @@ -16,17 +50,47 @@ plot_biadj_matrix <- function(data, geo_dim, kng_dim, kng_nbr, plot(BM, order, ...) } -plot.rks_biadj_matrix <- function(BM, order = "DU", ...) { + +# https://www.r-bloggers.com/creating-an-image-of-a-matrix-in-r-using-image/ + +#' @name +#' plot.rks_biadj_matrix +#' +#' @title +#' Plot a biadjacency matrix +#' +#' @description +#' The function plots a biadjacency matrix. +#' +#' @details +#' Use \code{\link{plot_biadj_matrix}} instead of this function to have a better +#' and easier user experience. +#' +#' @encoding UTF-8 +#' +#' @param x It is expected to be an object of class \code{rks_biadj_matrix}. +#' @param order It is the way in which rows and columns of the matrix are +#' re-arranged. By now the only possible option is "DU" that arranges the rows +#' and columns in order inverse to their degree (i.e., to the +#' \emph{diversification} of the geographical area and the \emph{ubiquity} of +#' the knowledge dimension considered.) +#' @param ... Other parameters taken by plot. +#' @return Nothing +#' +#' @export + +plot.rks_biadj_matrix <- function(x, order = "DU", ...) { if (order == "DU") { - du <- .get_du(BM) + du <- .get_du(x) row_order <- order(du$diversification) col_order <- order(du$ubiquity, decreasing = T) } - bm <- BM[row_order, col_order] - rotate <- function(x) t(apply(x, 2, rev)) - image(rotate(bm), + x <- x[row_order, col_order] + rotate <- function(m) t(apply(m, 2, rev)) + image(rotate(x), col = c('white', 'black'), - xlab = attr(BM, "kng_dim"), ylab = attr(BM, "geo_dim"), + xlab = attr(x, "kng_dim"), ylab = attr(x, "geo_dim"), axes = FALSE, ...) box() + invisible() } diff --git a/man/ReKS.Rd b/man/ReKS.Rd new file mode 100644 index 0000000..ff81b55 --- /dev/null +++ b/man/ReKS.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ReKS.R +\docType{package} +\name{ReKS} +\alias{ReKS} +\alias{ReKS-package} +\title{ReKS: A package for computating some measure about the knowledge space +of a economic region.} +\description{ +ReKS: A package for computating some measure about the knowledge space +of a economic region. +} +\section{ReKS functions}{ + +\itemize{ +\item{\code{\link{entropy}}} +\item{\code{\link{entropy_decomposition}}} +\item{\code{\link{entropy_decomposition_panel}}} +\item{\code{\link{coherence}}} +\item{\code{\link{coherence_panel}}} +\item{\code{\link{complexity}}} +\item{\code{\link{fitness}}} +} +} + diff --git a/man/coherence.Rd b/man/coherence.Rd index 2d2e6a7..f57646e 100644 --- a/man/coherence.Rd +++ b/man/coherence.Rd @@ -1,5 +1,6 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/coherence.R +\encoding{UTF-8} \name{coherence} \alias{coherence} \title{Regional Coherence Index} @@ -44,23 +45,31 @@ only this. You can use it both on a panel data set (if you identify also a column with a temporal indication of the observations) or on cross-section data (by leaveing the parameter just said as NULL). -See: -\itemize{ -\item{Teece, Rumelt, Dosi and Winter (1994) 'Understanding Corporate -Coherence: Theory and Evidence', \emph{Journal of Economic Behavior \& -Organization}, 23, 1-30;} -\item{Nesta and Saviotti (2005) 'Coherence of the Knowledge Base and the -Firm's Innovative Performance: Evidence from the U.S. Pharmaceutical -Industry', \emph{Journal of Industrial Economics}, 53, 123-142;} -\item{Nesta and Saviotti (2006) 'Firm Knowledge and Market Value in -Biotechnology', \emph{Industrial and Corporate Change}, 15, 625-652;} -\item{Quatraro (2010) 'Knowledge Coherence, Variety and Economic Growth: -Manufacturing Evidence from Italian Regions', \emph{Research Policy}, 39, -1289-1302.} - -} } \examples{ RCI <- coherence(data = df, geo_dim = NUTS2, kng_dim = IPC.3dig, kng_nbr = N.patents) } +\references{ +Teece, Rumelt, Dosi and Winter (1994) ``Understanding Corporate +Coherence: Theory and Evidence'', \emph{Journal of Economic Behavior & +Organization}, 23, 1-30; + +Nesta and Saviotti (2005) ``Coherence of the Knowledge Base and the +Firm's Innovative Performance: Evidence from the U.S. Pharmaceutical +Industry'', \emph{Journal of Industrial Economics}, 53, 123-142; + +Nesta and Saviotti (2006) ``Firm Knowledge and Market Value in +Biotechnology'', \emph{Industrial and Corporate Change}, 15, 625-652; + +Bottazzi and Pirino (2010) ``Measuring Industry Relatedness and +Corporate Coherence'', \emph{SSRN Electronic Journal}, 11, 1--24; + +Quatraro (2010) ``Knowledge Coherence, Variety and Economic Growth: +Manufacturing Evidence from Italian Regions'', \emph{Research Policy}, 39, +1289-1302; + +Rocchetta and Mina (2017), ``Technological Coherence and the Adaptive +Resilience of Regional Economies'', \emph{Papers in Evolutionary Economic +Geography}, Utrecht University. +} diff --git a/man/coherence_panel.Rd b/man/coherence_panel.Rd index 1a1e8ba..becfb2e 100644 --- a/man/coherence_panel.Rd +++ b/man/coherence_panel.Rd @@ -1,5 +1,6 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/coherence_panel.R +\encoding{UTF-8} \name{coherence_panel} \alias{coherence_panel} \title{Regional Coherence Index for panel data} @@ -39,23 +40,31 @@ only this. You can use it both on a panel data set (if you identify also a column with a temporal indication of the observations) or on cross-section data (by leaveing the parameter just said as NULL). -See: -\itemize{ -\item{Teece, Rumelt, Dosi and Winter (1994) 'Understanding Corporate -Coherence: Theory and Evidence', \emph{Journal of Economic Behavior \& -Organization}, 23, 1-30;} -\item{Nesta and Saviotti (2005) 'Coherence of the Knowledge Base and the -Firm's Innovative Performance: Evidence from the U.S. Pharmaceutical -Industry', \emph{Journal of Industrial Economics}, 53, 123-142;} -\item{Nesta and Saviotti (2006) 'Firm Knowledge and Market Value in -Biotechnology', \emph{Industrial and Corporate Change}, 15, 625-652;} -\item{Quatraro (2010) 'Knowledge Coherence, Variety and Economic Growth: -Manufacturing Evidence from Italian Regions', \emph{Research Policy}, 39, -1289-1302.} - -} } \examples{ RCI <- coherence(data = df, time_dim = year, geo_dim = NUTS2, kng_dim = IPC.3dig, kng_nbr = N.patents) } +\references{ +Teece, Rumelt, Dosi and Winter (1994) ``Understanding Corporate +Coherence: Theory and Evidence'', \emph{Journal of Economic Behavior & +Organization}, 23, 1--30; + +Nesta and Saviotti (2005) ``Coherence of the Knowledge Base and the +Firm's Innovative Performance: Evidence from the U.S. Pharmaceutical +Industry'', \emph{Journal of Industrial Economics}, 53, 123-142; + +Nesta and Saviotti (2006) 'Firm Knowledge and Market Value in +Biotechnology', \emph{Industrial and Corporate Change}, 15, 625-652; + +Bottazzi and Pirino (2010) ``Measuring Industry Relatedness and +Corporate Coherence'', \emph{SSRN Electronic Journal}, 11, 1--24; + +Quatraro (2010) 'Knowledge Coherence, Variety and Economic Growth: +Manufacturing Evidence from Italian Regions', \emph{Research Policy}, 39, +1289-1302; + +Rocchetta and Mina (2017), ``Technological Coherence and the Adaptive +Resilience of Regional Economies'', \emph{Papers in Evolutionary Economic +Geography}, Utrecht University. +} diff --git a/man/complexity.Rd b/man/complexity.Rd index e8fd1d3..b705913 100644 --- a/man/complexity.Rd +++ b/man/complexity.Rd @@ -1,5 +1,6 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/complexity.R +\encoding{UTF-8} \name{complexity} \alias{complexity} \title{Regional Knowledge Complexity Index} @@ -46,23 +47,25 @@ A data.frame with the Complexity Index of each geographical area in each time step of analysis. } \description{ - -} -\details{ -See: -\itemize{ -\item{Hidalgo, Klinger, Barab{\'a}si and Hausmann (2007) "The Product Space -Conditions the Development of Nations", \emph{Science}, 317, 482--487;} -\item{Hidalgo and Hausmann (2009) "The Building Blocks of Economic -Complexity", \emph{PNAS}, 106, 10570--10575;} -\item{Antonelli, Crespi, Mongeau Ospina and Scellato (2017) "Knowledge -Composition, Jacobs Externalities and Innovation Performance in European -Regions", \emph{Regional Studies}, 51, 1708--1720;} -\item{Balland and Rigby (2017) "The Geography of Complex Knowledge", -\emph{Economic Geography}, 93, 1--23.} -} +The function computes the ``Technological Complexity'' of each geographical +area considered, in each given year, in line with the so called \emph{Method +of Reflections} (see the references below). } \examples{ RKCI <- complexity(data = df, time_dim = year, geo_dim = NUTS2, kng_dim = IPC.3dig, kng_nbr = N.patents) } +\references{ +Hidalgo, Klinger, Barabási and Hausmann (2007) ``The Product Space +Conditions the Development of Nations'', \emph{Science}, 317, 482--487; + +Hidalgo and Hausmann (2009) ``The Building Blocks of Economic +Complexity'', \emph{PNAS}, 106, 10570--10575; + +Antonelli, Crespi, Mongeau Ospina and Scellato (2017) ``Knowledge +Composition, Jacobs Externalities and Innovation Performance in European +Regions'', \emph{Regional Studies}, 51, 1708--1720; + +Balland and Rigby (2017) ``The Geography of Complex Knowledge'', +\emph{Economic Geography}, 93, 1--23. +} diff --git a/man/entropy.Rd b/man/entropy.Rd index 62668aa..5e2034f 100644 --- a/man/entropy.Rd +++ b/man/entropy.Rd @@ -1,5 +1,6 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/entropy.R +\encoding{UTF-8} \name{entropy} \alias{entropy} \title{Information Entropy} @@ -24,17 +25,19 @@ The function will return the information entropy of a given vector that reports the absolute frequency of each of the possible types/groups of observations of the database. It is also used internally by the entropy decomposition functions. -See: -\itemize{ -\item{Shannon (1948) "A Mathematical Theory of Communication", \emph{Bell -System Technical Journal}, 27, 379--423;} -\item{Theil (1967) \emph{Economics and Information Theory}, North-Holland;} -\item{Theil (1972) \emph{Statistical Decomposition Analysis}, North-Holland;} -\item{Frenken (2007) "Entropy statistics and information theory", in -Hanusch and Pyka (Eds.) \emph{Elgar Companion to Neo-Schumpeterian -Economics}, Edward Elgar.} -} } \examples{ etpy <- entropy(c(1,3,5,2,4,9,1,6,10)) } +\references{ +Shannon (1948) ``A Mathematical Theory of Communication'', \emph{Bell +System Technical Journal}, 27, 379--423; + +Theil (1967) \emph{Economics and Information Theory}, North-Holland; + +Theil (1972) \emph{Statistical Decomposition Analysis}, North-Holland; + +Frenken (2007) ``Entropy Statistics and Information Theory'', in +Hanusch and Pyka (Eds.) \emph{Elgar Companion to Neo-Schumpeterian +Economics}, Edward Elgar. +} diff --git a/man/entropy_decomposition.Rd b/man/entropy_decomposition.Rd index 97eb1f9..2c6c605 100644 --- a/man/entropy_decomposition.Rd +++ b/man/entropy_decomposition.Rd @@ -1,5 +1,6 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/entropy_decomposition.R +\encoding{UTF-8} \name{entropy_decomposition} \alias{entropy_decomposition} \title{Entropy Decoposition Theorem} @@ -26,29 +27,34 @@ The total (undecomposed) entropy is equal to the sum of the two decomposed components. The within-groups component is equal to the weighted average of the entropy of each of the groups. So the between-groups component is equal to the residual entropy. -See: -\itemize{ -\item{Theil (1972) \emph{Statistical Decomposition Analysis}, North-Holland;} -\item{Zadjenweber (1972) "Une Application de la Th{\'e}orie de l’Information -{\`a} l'{\'E}conomie: La Mesure de la Concentration, \emph{Revue d'Economie -Politique}, 82, 486–-510;} -\item{Attaran (1985) "Industrial Diversity and Economic Performance in U.S. -Areas, \emph{The Annals of Regional Science}, 20, 44--54;} -\item{Frenken (2007) "Entropy statistics and information theory", in -Hanusch and Pyka (Eds.) \emph{Elgar Companion to Neo-Schumpeterian -Economics}, Edward Elgar.} -\item{Frenken, van Oort and Verburg (2007) "Related Variety, Unrelated -Variety and Regional Economic Growth", \emph{Regional Studies}, 41, -685--697;} -\item{Quatraro (2010) 'Knowledge Coherence, Variety and Economic Growth: -Manufacturing Evidence from Italian Regions', \emph{Research Policy}, 39, -1289--1302;} -\item{Rocchetta and Mina (2017), "Technological Coherence and the Adaptive -Resilience of Regional Economies", \emph{Papers in Evolutionary Economic -Geography}, Utrecht University.} -} } \examples{ etpy_decomp <- entropy_decomposition(data, grps) etpy_decomp <- entropy_decomposition(table(data), grps) } +\references{ +Theil (1972) \emph{Statistical Decomposition Analysis}, North-Holland; + +Zadjenweber (1972) ``Une Application de la Théorie de l'Information +à l'Économie: La Mesure de la Concentration'', \emph{Revue d'Economie +Politique}, 82, 486--510; + +Attaran (1985) ``Industrial Diversity and Economic Performance in U.S. +Areas'', \emph{The Annals of Regional Science}, 20, 44--54; + +Frenken (2007) ``Entropy Statistics and Information Theory'', in +Hanusch and Pyka (Eds.) \emph{Elgar Companion to Neo-Schumpeterian +Economics}, Edward Elgar; + +Frenken, van Oort and Verburg (2007) ``Related Variety, Unrelated +Variety and Regional Economic Growth'', \emph{Regional Studies}, 41, +685--697; + +Quatraro (2010) ``Knowledge Coherence, Variety and Economic Growth: +Manufacturing Evidence from Italian Regions'', \emph{Research Policy}, 39, +1289--1302; + +Rocchetta and Mina (2017), ``Technological Coherence and the Adaptive +Resilience of Regional Economies'', \emph{Papers in Evolutionary Economic +Geography}, Utrecht University. +} diff --git a/man/entropy_decomposition_panel.Rd b/man/entropy_decomposition_panel.Rd index a76b2d4..4cff643 100644 --- a/man/entropy_decomposition_panel.Rd +++ b/man/entropy_decomposition_panel.Rd @@ -1,5 +1,6 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/entropy_decomposition_panel.R +\encoding{UTF-8} \name{entropy_decomposition_panel} \alias{entropy_decomposition_panel} \title{Entropy Decomposition Theorem for panel data} @@ -46,27 +47,6 @@ so that, besides the overall entropy level, also the value of the between- and within-groups information entropy is provided. Internally the function computes and temorarily stores also other values. However they are not provided in the oputput dataframe. -See: -\itemize{ -\item{Theil (1972) \emph{Statistical Decomposition Analysis}, North-Holland;} -\item{Zadjenweber (1972) "Une Application de la Th{\'e}orie de l’Information -{\`a} l'{\'E}conomie: La Mesure de la Concentration, \emph{Revue d'Economie -Politique}, 82, 486–-510;} -\item{Attaran (1985) "Industrial Diversity and Economic Performance in U.S. -Areas, \emph{The Annals of Regional Science}, 20, 44--54;} -\item{Frenken (2007) "Entropy statistics and information theory", in -Hanusch and Pyka (Eds.) \emph{Elgar Companion to Neo-Schumpeterian -Economics}, Edward Elgar.} -\item{Frenken, van Oort and Verburg (2007) "Related Variety, Unrelated -Variety and Regional Economic Growth", \emph{Regional Studies}, 41, -685--697;} -\item{Quatraro (2010) 'Knowledge Coherence, Variety and Economic Growth: -Manufacturing Evidence from Italian Regions', \emph{Research Policy}, 39, -1289--1302;} -\item{Rocchetta and Mina (2017), "Technological Coherence and the Adaptive -Resilience of Regional Economies", \emph{Papers in Evolutionary Economic -Geography}, Utrecht University.} -} } \examples{ Variety(data = data, kng_nbr = N, geo_dim = region, @@ -75,3 +55,29 @@ geo_dim_label = "region", time_dim_label = "year") Variety(data = data$N) Variety(data = data, kng_nbr = freq, kng_dim_upper = IPC.3) } +\references{ +Theil (1972) \emph{Statistical Decomposition Analysis}, North-Holland; + +Zadjenweber (1972) ``Une Application de la Théorie de l'Information +à l'Économie: La Mesure de la Concentration'', \emph{Revue d'Economie +Politique}, 82, 486--510; + +Attaran (1985) ``Industrial Diversity and Economic Performance in U.S. +Areas'', \emph{The Annals of Regional Science}, 20, 44--54; + +Frenken (2007) ``Entropy Statistics and Information Theory'', in +Hanusch and Pyka (Eds.) \emph{Elgar Companion to Neo-Schumpeterian +Economics}, Edward Elgar; + +Frenken, van Oort and Verburg (2007) ``Related Variety, Unrelated +Variety and Regional Economic Growth'', \emph{Regional Studies}, 41, +685--697; + +Quatraro (2010) ``Knowledge Coherence, Variety and Economic Growth: +Manufacturing Evidence from Italian Regions'', \emph{Research Policy}, 39, +1289--1302; + +Rocchetta and Mina (2017), ``Technological Coherence and the Adaptive +Resilience of Regional Economies'', \emph{Papers in Evolutionary Economic +Geography}, Utrecht University. +} diff --git a/man/fitness.Rd b/man/fitness.Rd index b834b99..742dd17 100644 --- a/man/fitness.Rd +++ b/man/fitness.Rd @@ -1,5 +1,6 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/fitness.R +\encoding{UTF-8} \name{fitness} \alias{fitness} \title{Regional Knowledge Fitness Index} @@ -43,26 +44,25 @@ A data.frame with the Fitness Index of each geographical area in each time step of analysis. } \description{ - -} -\details{ -See: -\itemize{ -\item{Tacchella, Cristelli, Caldarelli, Gabrielli and Pietronero (2012) -"A New Metrics for Countries' Fitness and Products' Complexity", -\emph{Scientific Reports}, 2, 1--7;} -\item{Tacchella, Cristelli, Caldarelli, Gabrielli and Pietronero (2013) -"Economic Complexity: Conceptual Grounding of a New Metrics for Global -Competitiveness", \emph{Journal of Economic Dynamics and Control}, 37, -1683--1691;} -\item{Cristelli, Gabrielli, Tacchella, Caldarelli and Pietronero (2013) -"Measuring the Intangibles: A Metrics for the Economic Complexity of -Countries and Products", \emph{PLOS ONE}, 8, e70726;} -\item{Balland and Rigby (2017) "The Geography of Complex Knowledge", -\emph{Economic Geography}, 93, 1--23.} -} +The function computes the Fitness (i.e. \emph{competitiveness}) of each given +geographical area considered, in each year provided (see the references +below for further details). } \examples{ RKFI <- fitness(data = df, time_dim = year, geo_dim = NUTS2, kng_dim = IPC.3dig, kng_nbr = N.patents) } +\references{ +Tacchella, Cristelli, Caldarelli, Gabrielli and Pietronero (2012) +``A New Metrics for Countries' Fitness and Products' Complexity'', +\emph{Scientific Reports}, 2, 1--7; + +Tacchella, Cristelli, Caldarelli, Gabrielli and Pietronero (2013) +``Economic Complexity: Conceptual Grounding of a New Metrics for Global +Competitiveness'', \emph{Journal of Economic Dynamics and Control}, 37, +1683--1691; + +Cristelli, Gabrielli, Tacchella, Caldarelli and Pietronero (2013) +``Measuring the Intangibles: A Metrics for the Economic Complexity of +Countries and Products'', \emph{PLOS ONE}, 8, e70726; +} diff --git a/man/plot.rks_biadj_matrix.Rd b/man/plot.rks_biadj_matrix.Rd new file mode 100644 index 0000000..20682b3 --- /dev/null +++ b/man/plot.rks_biadj_matrix.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plot_biadj_matrix.R +\encoding{UTF-8} +\name{plot.rks_biadj_matrix} +\alias{plot.rks_biadj_matrix} +\title{Plot a biadjacency matrix} +\usage{ +\method{plot}{rks_biadj_matrix}(x, order = "DU", ...) +} +\arguments{ +\item{x}{It is expected to be an object of class \code{rks_biadj_matrix}.} + +\item{order}{It is the way in which rows and columns of the matrix are +re-arranged. By now the only possible option is "DU" that arranges the rows +and columns in order inverse to their degree (i.e., to the +\emph{diversification} of the geographical area and the \emph{ubiquity} of +the knowledge dimension considered.)} + +\item{...}{Other parameters taken by plot.} +} +\value{ +Nothing +} +\description{ +The function plots a biadjacency matrix. +} +\details{ +Use \code{\link{plot_biadj_matrix}} instead of this function to have a better +and easier user experience. +} diff --git a/man/plot_biadj_matrix.Rd b/man/plot_biadj_matrix.Rd new file mode 100644 index 0000000..b96172e --- /dev/null +++ b/man/plot_biadj_matrix.Rd @@ -0,0 +1,47 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plot_biadj_matrix.R +\encoding{UTF-8} +\name{plot_biadj_matrix} +\alias{plot_biadj_matrix} +\title{Plot a biadjacency matrix} +\usage{ +plot_biadj_matrix(data, geo_dim, kng_dim, kng_nbr, binary_mode, order = "DU", + ...) +} +\arguments{ +\item{data}{It must be a ``long'' dataframe.} + +\item{geo_dim}{It must be a symbolic variable that denotes the name of the +column of the dataframe that represents the geographical units of analysis.} + +\item{kng_dim}{It must be a symbolic variable that denotes the name of the +column of the dataframe that represents the technological knowledge units of +analysis.} + +\item{kng_nbr}{It must be a symbolic variable that denotes the name of the +column of the dataframe that represents the number of technological units +of a given type that a given geographical units owns.} + +\item{binary_mode}{It must be a string that represents the way in which the +data are transformed from count values to binary values. It can be 'none', +'simple', 'RTA', 'RCA', 'higher_quartiles', 'higher_quartiles_kng', +'higher_deciles_kng'.} + +\item{order}{It must be a string that represents the way in which the matrix +rows and columns are re-arranged. By now the only possible option is "DU" that arranges the rows +and columns in order inverse to their degree (i.e., to the +\emph{diversification} of the geographical area and the \emph{ubiquity} of +the knowledge dimension considered.)} + +\item{...}{Other parameters taken by plot.} +} +\value{ +Nothing +} +\description{ +The function plots a biadjacency matrix. +} +\details{ +The function transforms the ``long'' table provided in a biadjacency matrix +and than plot it. +}