chgeohybrid: Calculating the the monthly chained geohybrid price index
Description
This function returns a value (or vector of values) of the monthly chained geohybrid price index. The geohybrid index was proposed by Bialek (2020) and it uses correlation coefficients between prices and quantities.
Usage
chgeohybrid(data, start, end, base = start, interval = FALSE)
Arguments
data
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), quantities (as positive numeric) and prodID (as numeric, factor or character).
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".
base
The prior period used in the geohybrid price index formula (as character) limited to the year and month, e.g. "2020-01"
interval
A logical value indicating whether the function is to compare the research period defined by end to the base period defined by start (then interval is set to FALSE) or all fixed base indices are to be calculated. In this latter case, all months from the time interval <start,end> are considered and start defines the base period (interval is set to TRUE).
Value
The function returns a value (or vector of values) of the monthly chained geohybrid price index depending on the interval parameter. If the interval parameter is set to TRUE, the function returns a vector of price index values without dates. To get information about both price index values and corresponding dates, please see functions: price_index, price_indices or final_index. The function does not take into account aggregating over outlets or product subgroups (to consider these types of aggregating, please use the final_index or the final_index2 function).
References
Bialek, J. (2020). Proposition of a Hybrid Price Index Formula for the Consumer Price Index Measurement. Equilibrium. Quarterly Journal of Economics and Economic Policy, 15(4), 697-716.
# NOT RUN {chgeohybrid(sugar, start="2019-12", end="2020-05", base="2018-12")
# }# NOT RUN {chgeohybrid(milk, start="2019-12", end="2020-08", base="2018-12", interval=TRUE)
# }