Vector that contains the names of the quantities that
belong to the prices.
base
The base period(s) to calculate the indices (see details).
data
Dataframe that contains the prices and quantities.
method
Which price index: "Laspeyres", "Paasche" or "Fisher".
na.rm
a logical value passed to 'mean()' when
calculating the base.
weights
logical. Should an attribute 'weights' that contains the
relatives weights of each quantity be added?
Details
The argument 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 price 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.