QU {PriceIndices} | R Documentation |
Calculating the quality adjusted unit value index (QU index)
Description
This function returns a value of the quality adjusted unit value index (QU index) for a given set of adjustment factors.
Usage
QU(data, start, end, v)
Arguments
data |
The user's data frame with information about sold products. It must contain columns: |
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". |
v |
The data frame with adjustment factors for at least all matched prodIDs. It must contain two columns: |
Value
This function returns a value of the quality adjusted unit value index (QU index) for a given set of adjustment factors (adjusted factors must be available for all matched prodIDs).
References
Chessa, A.G. (2016). A New Methodology for Processing Scanner Data in the Dutch CPI. Eurona 1/2016, 49-69.
Examples
## Creating a data frame with artificial adjustment factors
## (random numbers from uniform distribution U[1,2])
prodID<-unique(milk$prodID)
values<-stats::runif(length(prodID),1,2)
v<-data.frame(prodID,values)
## Calculating the QU index for the created data frame 'v'
QU(milk, start="2018-12", end="2019-12", v)