This function returns a value or values of the selected price indices.
price_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,
interval = FALSE
)
This general function returns a value or values of the selected price indices. If the interval
parameter is set to TRUE, then it returns a data frame where its first column indicates dates and the remaining columns show corresponding values of all selected price indices. 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).
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 essential even if the selected index is an unweighted formula (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
).
A vector of character strings indicating multilateral price index formulas that 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" and their additional variants: "window_published", "half_published" and "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 logical value indicating whether the function is to provide the price index comparing 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 presented (the fixed base month is defined by start
).
price_indices(milk, start="2018-12",end="2019-04",bilateral=c("jevons"),
fbmulti=c("tpd"),fbwindow=c(6),interval=TRUE)
price_indices(milk, start="2018-12", end="2019-05",
fbmulti=c("tpd","geks"),fbwindow=c(10,12),interval=TRUE)
Run the code above in your browser using DataLab