multicompPAR: multicompPAR

Description Usage Arguments Details Value Author(s) References Examples

View source: R/funcs_multilateral.R

Description

This function computes transitive index numbers for cross-sections and panel data using either the EKS or the Minimum-spannin-tree method. It can distribute workload accross multiple CPUs.

Usage

1
2
multicompPAR(data.x, data.y, idx, transitivity, var.agg, bench, period,
 plotting = FALSE, Cores)

Arguments

data.x

A data frame containing data on prices or quantites. To get a quantity index, data.x should contain information on quantities. To get a price index, data.x should contain info on prices corresponding to the quantities in data.y. Each column should represent an item of the basket. Temporal and spatial dimensions are represented by row, as in 'long' formats. Id and/or time variables must be included among the columns.

data.y

A data frame containing data on prices or quantites. It represents the set of weights to be used in weighting data contained in data.x. To get a quantity index, data.y should contain information on prices corresponding to quantities in data.x. To get a price index, data.y should contain info on quantities. Each column should represent an item of the basket. Temporal and spatial dimensions are represented by row, as in 'long' formats. Id and/or time variables should be included among the columns.

idx

Index number formula to be used. It should be either 'paasche', 'laspeyres', 'fisher' or 'tornqvist'.

transitivity

The transitivization method to be used. It should be either 'eks' or 'mst'.

var.agg

The time and id variables of the data frames. In the case of panel data this should be a vector of two elements where the first element is the name of the column (of data.x and data.y) that contains the time dimension, while the second element is the name of the column that contains the spatial dimension.

bench

The id of the benchmark unit.

period

The benchmark period. For cross-sectional data it should be set to NULL.

plotting

If set to TRUE, it plots the minimum-spanning-tree. It is not available for transitivity='eks'.

Cores

Numbers of CPUs to be used for the calculations.

Details

The function uses the function makePSOCKcluster from the parallel package to set up the cluster. No other parallel package is included yet.

Value

It returns the vector of transitive index numbers.

Author(s)

Edoardo Baldoni

References

T. J. Coelli, D. S. Prasada Rao, C. J. O'Donnell, and G. E. Battese. An introduction to Efficiency and Productivity Analysis, 2nd edition. Springer Science + Business Media, New York, 2005.

R. J. Hill. Constructing price indexes across space and time: The case of the European Union. The American Economic Review, 94(5):1379-1410, 2004.

Rao D.S.P., O'Donnell C.J., Ball V.E., 2002. Transitive Multilateral Comparisons of Agricultural Output, Input, and Productivity: A Nonparametric Approach. In: Ball V.E., Norton G.W. Agricultural Productivity. Studies in Productivity and Efficiency, vol 2. Springer, Boston, MA.

Examples

1
2
3
4
5
6
7
library(igraph)
library(ape)
library(parallel)

data('multil_data')
multicompPAR(dat.q,dat.p,transitivity='mst',var.agg=c('year','region'),
 bench=1,period=2010,idx='fisher',Cores=1,plotting=FALSE)

multilaterals documentation built on May 2, 2019, 4:02 p.m.