This function returns values of the selected retrospective price index.
retro_index(
data,
start,
end,
formula = "fisher",
approach = "correction",
method_index = "additive",
method_weights = "additive",
lambda = "linear",
sigma = 0.7,
df = FALSE,
name = "RETRO_index"
)The function returns values of the selected retrospective price index for all period between start and end (start is always the fixed base period). Depending on the formula parameter it can provide values of the Diewert-Huwiler-Kohli-Hansen index (DHKH) or run correction and imputation approach, as well as the mixture of them, to obtain a vector (or a data frame) of retrospective price indices. Note that the 'CES-imputation' approach requires elasticity of substitution. The user may control the relevance of the second expenditure reference period (end) relative to the relevance of the first (base) expenditure reference period (start) by using the lambda parameter.
The user's data frame with information about sold products. It must contain columns: time (as Date in format: year-month-day,e.g. '2020-12-01'), prices (as positive numeric) and prodID (as numeric, factor or character). A column quantities (as positive numeric) is also needed because this function uses unit values as monthly prices.
The base period, being the first expenditure reference period (as character), limited to the year and month, e.g. "2020-03". We assume that the quantity (and thus expenditure) information is available for this period.
The second expenditure reference period (as character) limited to the year and month, e.g. "2020-04". We assume that the quantity (and thus expenditure) information is available for this period.
A parameter indicating which index formula to use within the correction or imputation approach, with the values 'fisher' and 'tornqvist' available. If the parameter value is set to 'dhkh', then the retrospective Diewert-Huwiler-Kohli-Hansen index (DHKH) will be computed instead of the correction or imputation method.
A parameter indicating which approach to use to obtain retrospectively computed price indices. Available options are: 'correction', 'imputation', 'correction-imputation', or 'CES-imputation'.
A parameter indicating how to apply the correction approach. Available options are: 'additive' and 'multiplicative'.
A parameter indicating how to apply the imputation approach for calculating weights for all periods within the time interval. Available options are: 'additive' and 'multiplicative'.
A parameter indicating the relevance of the second expenditure reference period relative to the relevance of the first (base) expenditure reference period. Available options are: 'linear' and 'sinusoidal'.
A parameter indicating elasticity of substitution.
A parameter indicating whether the function should return a data frame with dates and retrospective index values (TRUE) or just a vector of its values for subsequent months (FALSE).
A parameter indicating the index (or method) name returned in a resulting data frame.
Diewert, E. W., Huwiler, M., Kohli, U. (2009). Retrospective approximations of superlative price indexes for years where expenditure data is unavailable. In: Biggeri, L., Ferrari, G. (eds), Price indexes in time and space. Contributions to statistics., Physica-Verlag, Heidelberg, 25-42.
von Auer, L., (2024). Retrospective computations of price index numbers: theory and application. Review of Income and Wealth, 70(1), 60-79.
retro_index(milk, start="2018-12",end="2019-04",formula="dhkh", df=TRUE)
retro_index(milk, start="2018-12",end="2019-04", approach="correction",
method_index = "multiplicative", lambda="sinusoidal")
Run the code above in your browser using DataLab