| retro_index | R Documentation |
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"
)
data |
The user's data frame with information about sold products. It must contain columns: |
start |
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. |
end |
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. |
formula |
A parameter indicating which index formula to use within the |
approach |
A parameter indicating which approach to use to obtain retrospectively computed price indices. Available options are: 'correction', 'imputation', 'correction-imputation', or 'CES-imputation'. |
method_index |
A parameter indicating how to apply the correction approach. Available options are: 'additive' and 'multiplicative'. |
method_weights |
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'. |
lambda |
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'. |
sigma |
A parameter indicating elasticity of substitution. |
df |
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). |
name |
A parameter indicating the index (or method) name returned in a resulting data frame. |
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.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.