chIQMp: Calculating the monthly chained implicit quadratic mean of...

View source: R/f_chain_indices.R

chIQMpR Documentation

Calculating the monthly chained implicit quadratic mean of order r price index

Description

This function returns a value (or vector of values) of the monthly chained implicit quadratic mean of order r price index.

Usage

chIQMp(data, start, end, r = 2, 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".

r

The real and non-zero parameter.

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 implicit quadratic mean of order r price index - see CPI Manual (2004), Section 17.37, formula 17.32 (page 321).

References

(2004). Consumer Price Index Manual. Theory and practice. ILO/IMF/OECD/UNECE/Eurostat/The World Bank, International Labour Office (ILO), Geneva.

Examples

chIQMp(sugar, start="2019-01", end="2020-01")
chIQMp(sugar, start="2019-01", end="2020-01", r=1.3, interval=TRUE)

PriceIndices documentation built on July 9, 2023, 6:20 p.m.