relativeDissimilarity: Computes measures of relative dissimilarity between all...

Description Usage Arguments Value References Examples

View source: R/dissimilarity.R

Description

A function to compute the relative price dissimilarity between two vectors of prices.

Usage

1
2
3
4
5
6
7
8
9
relativeDissimilarity(
  x,
  pvar,
  qvar,
  pervar,
  prodID,
  indexMethod = "fisher",
  similarityMethod = "logquadratic"
)

Arguments

x

A dataframe containing price, quantities, a time period index and a product identifier.

pvar

A string identifying the price variable.

qvar

A string identifying the quantity variable.

pervar

A string identifying the time index variable.

prodID

A string identifying the product ID.

indexMethod

A string identifying the index method to use in the calculation. Not relevant for similarityMethod = PLSpread. Supported methods are fisher and tornqvist. Default is Fisher.

similarityMethod

A string specifying the formula for calculating the relative dissimilarity. Valid options are logquadratic, asymplinear, PLSpread and predictedshare. Default is logquadratic.

Value

A matrix of dissimilarity measures. The first two columns are the possible combinations of bilateral comparisons and the third column is the dissimilarity measure.

References

Diewert, W.E. (2002). "Similarity and Dissimilarity Indexes: An Axiomatic Approach" Discussion Paper No. 0210, Department of Economics, University of British Columbia.

Examples

1
2
3
4
5
# estimate the dissimilarity between periods in the CES_sigma_2 dataset
# using the log quadratic measure of dissimilarity
relativeDissimilarity(CES_sigma_2, pvar = "prices", qvar="quantities",
pervar = "time", prodID = "prodID", indexMethod="fisher",
similarityMethod = "logquadratic")

IndexNumR documentation built on Feb. 7, 2022, 5:09 p.m.