Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


diverse (version 0.1.1)

disparity: A procedure to compute the sum and average of disparities

Description

Computes the sum and the average of distances or disparities between the categories.

Usage

disparity(data, method = "euclidean", category_row = FALSE)

Arguments

data
A numeric matrix with entities $i$ in the rows and categories $j$ in the columns. Cells show the respective value (value of abundance) of entity $i$ in the category $j$. It can also be a transpose of the previous matrix, that is, a matrix with categories
method
A distance or dissimilarity method available in "proxy" package as for example "Euclidean", "Kullback" or "Canberra". This parameter also accepts a similarity method available in the "proxy" package, as for example: "cosine", "correlation" or "Jaccard" am
category_row
A flag to indicate that categories are in the rows. The analysis assumes that the categories are in the columns of the matrix. If the categories are in the rows and the entities in the columns, then the parameter "category_row" has to be set to TRUE. The

Value

  • A data frame with disparity measures for each entity in the dataset. Both the sum of disparities and the average of disparities are computed.

Examples

Run this code
data(pantheon)
disparity(data= pantheon)
disparity(data = pantheon, method='Canberra')
#For scientific publications
#Same disparities, since all countries authored all entities
disparity(scidat)
disparity(data= scidat, method='cosine')
#Creating differences by measuring Revealed Compartive Advantages
disparity(values(scidat, norm='rca', filter=1))
#Activity Index for scientometrics
disparity(values(scidat, norm='ai', filter=0), method='cosine')
#Using binarization of values and a binary metric for dissimilarities.
disparity(values(scidat, norm='ai', filter=0, binary=TRUE), method='jaccard')

Run the code above in your browser using DataLab