unit_value_index {PriceIndices} | R Documentation |
Calculating the unit value index
Description
This function returns a value (or vector of values) of the unit value index
Usage
unit_value_index(data, start, end, interval = FALSE)
Arguments
data |
The user's data frame with information about sold products. It must contain columns: |
start |
The base period (as character) limited to the year and month, e.g. "2020-03". |
end |
The research period (as character) limited to the year and month, e.g. "2020-04". |
interval |
A logical value indicating whether the function is to compare the research period defined by |
Value
The function returns a value (or vector of values) of the unit value index. The value index is calculated as the unit value at time start
divided by the unit value at time start
.
References
(2004). Consumer Price Index Manual. Theory and practice. ILO/IMF/OECD/UNECE/Eurostat/The World Bank, International Labour Office (ILO), Geneva.
Examples
unit_value_index(sugar, start="2019-01", end="2020-01")
unit_value_index(sugar, start="2019-01", end="2020-01", interval=TRUE)