This function returns a figure with plots of selected price indices.
compare_indices(
data,
start,
end,
bilateral = c(),
bindex = c(),
base = c(),
cesindex = c(),
sigma = c(),
simindex = c(),
fbmulti = c(),
fbwindow = c(),
splicemulti = c(),
splicewindow = c(),
splice = c(),
namebilateral = bilateral,
namebindex = bindex,
namecesindex = cesindex,
namesimindex = simindex,
namefbmulti = fbmulti,
namesplicemulti = splicemulti,
date_breaks = "1 month"
)
This function calculates selected bilateral or/and multilateral price indices and returns a figure with plots of these indices (together with dates on X-axis and a corresponding legend). The function does not take into account aggregating over outlets or product subgroups (to consider these types of aggregating, please use functions: final_index
and compare_final_indices
).
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
is also essential (as positive numeric) because unit values are calculated.
The base period (as character) limited to the year and month, e.g. "2019-12".
The research period (as character) limited to the year and month, e.g. "2020-04".
A vector of character strings indicating bilateral price index formulas that are to be calculated. To see available options please use the link: PriceIndices
.
A vector of character strings indicating Lowe- or Young-type price index formulas that are to be calculated. Available options are: young
, geoyoung
, lowe
and geolowe
.
The vector of prior periods used in the Young- or Lowe-type price indices. Each element of the vector (as character) must be limited to the year and month, e.g. "2020-01".
A vector of character strings indicating CES price index formulas that are to be calculated. To see available options, please use the link: PriceIndices
.
The vector of elasticity of substitution parameters used in the Lloyed-Moulton and AG Mean indices.
A vector of character strings indicating multilateral price index formulas based on relative price and quantity similarity that are to be calculated. To see available options, please use the link: PriceIndices
.
A vector of character strings indicating multilateral price index formulas that are to be calculated. The available set of indices includes full-window multilateral indices or their FBEW and FBMW extensions.To see available options, please use the link: PriceIndices
.
A vector of integers. Each element of the vector defines the length of the time window of the corresponding multilateral index (if it is selected by fbmulti
).
The vector of character strings indicating multilateral price index formulas are to be extended by using splicing methods. To see available options please use the link: PriceIndices
.
A vector of integers. Each element of the vector defines the length of the time window of the corresponding multilateral index (if it is selected by splicemulti
).
A vector of character strings. Each element of the vector indicates the splicing method is to be used for the corresponding multilateral index (if it is selected by splicemulti
). Available values of vector elements are: "movement", "window","half","mean","window_published","half_published","mean_published".
A vector of character strings describing names of bilateral price indices that are to be displayed. If this vector is empty, then default names are used.
A vector of character strings describing names of Young- and/or Lowe-type price indices are to be displayed. If this vector is empty then default names are used.
A vector of character strings describing names of CES price indices that are to be displayed. If this vector is empty, then default names are used.
A vector of character strings describing names of multilateral price index formulas based on relative price and quantity similarity that are to be displayed. If this vector is empty, then default names are used.
A vector of character strings describing names of full-window multilateralindices or their FBEW and FBMW extensions that are to be displayed. If this vector is empty, then default names are used.
A vector of character strings describing names of multilateral splice indices that are to be displayed. If this vector is empty, then default names are used.
A string giving the distance between breaks on the X axis like "1 month" (default value) or "4 months".
compare_indices(milk, start="2018-12", end="2019-04",
bilateral=c("jevons"),fbmulti=c("tpd"),fbwindow=c(6))
compare_indices(milk, start="2018-12", end="2019-05",
fbmulti=c("tpd","geks"),fbwindow=c(10,12))
Run the code above in your browser using DataLab