price_relative {piar} | R Documentation |
Calculate period-over-period price relatives
Description
Construct period-over-period price relatives from information on prices and products over time.
Usage
price_relative(x, period, product)
Arguments
x |
A numeric vector of prices. |
period |
A factor, or something that can be coerced into one, that
gives the corresponding time period for each element in |
product |
A factor, or something that can be coerced into one, that
gives the corresponding product identifier for each element in |
Value
A numeric vector of price relatives, with product
as names.
See Also
gpindex::back_period()
to get only the back price.
gpindex::base_period()
for making fixed-base price relatives.
carry_forward()
and shadow_price()
to impute missing prices.
gpindex::outliers
for methods to identify outliers with price relatives.
Examples
price_relative(1:6, rep(1:2, each = 3), rep(letters[1:3], 2))
[Package piar version 0.7.0 Index]