quantityIndex( prices, quantities, base, data, method = "Laspeyres", na.rm = FALSE, weights = FALSE )
prices
.mean()
' when
calculating the base
.base
can be either
(a) a single number: the row number of the base prices and quantities,
(b) a vector indicating several observations: The means of these
observations are used as base prices and quantities, or
(c) a logical vector with the same length as the data
: The
means of the observations indicated as 'TRUE' are used as base prices
and quantities.If any values used for calculating the quantity index (e.g. current quantities, base quantities, current prices or base prices) are not available (NA), they are ignored (only) if they are multiplied by zero.
quantityIndex
. data( Missong03E7.7 )
# Laspeyres Quantity Indices
quantityIndex( c( "p.beef", "p.veal", "p.pork" ),
c( "q.beef", "q.veal", "q.pork" ), 1, Missong03E7.7 )
# Paasche Quantity Indices
quantityIndex( c( "p.beef", "p.veal", "p.pork" ),
c( "q.beef", "q.veal", "q.pork" ), 1, Missong03E7.7, "Paasche" )
data( Bleymueller79E25.1 )
# Laspeyres Quantity Indices
quantityIndex( c( "p.A", "p.B", "p.C", "p.D" ), c("q.A", "q.B", "q.C", "q.D" ),
1, Bleymueller79E25.1 )
# Paasche Quantity Indices
quantityIndex( c( "p.A", "p.B", "p.C", "p.D" ), c("q.A", "q.B", "q.C", "q.D" ),
1, Bleymueller79E25.1, "Paasche" )
Run the code above in your browser using DataLab