Construct period-over-period price relatives from information on prices and products over time.
Usage
price_relative(x, ...)
# Default S3 method
price_relative(x, period, product, ...)
# S3 method for class 'data.frame'
price_relative(x, formula, ...)Arguments
- x
[object]Either a numeric vector (or something that can be coerced into one) or data frame of prices.- ...
Further arguments passed to or used by methods.
- period
[factor]A factor, or something that can be coerced into one, that gives the corresponding time period for each element inx. The ordering of time periods follows the levels ofperiodto agree withcut().- product
[factor]A factor, or something that can be coerced into one, that gives the corresponding product identifier for each element inx.- formula
[formula]A two-sided formula, or something that can be coerced into one, with prices on the left-hand side and time periods and products (in that order) on the right-hand side.
See also
back_period() to get only the back price or base price.
impute_prices() to impute missing prices.
outliers() for methods to identify outliers with price relatives.
