# priceIndicator: Calculate a price indicator In IndexNumR: Index Number Calculation

## Description

This calculates a price indicator. This is calculated using the differences approach to index number theory, where the change in prices and quantities from one period to the next is additive. Therefore, the change in total value is the sum of the change in prices and the change in quantities. Such a value decomposition can be obtained using `valueDecomposition`.

`vignette(topic = "indexnumr", package = "IndexNumR")`

## Usage

 `1` ```priceIndicator(x, pvar, qvar, pervar, prodID, method, sample = "matched") ```

## Arguments

 `x` data frame with input data `pvar` character string for the name of the price column `qvar` character string for the name of the quantity column `pervar` character string for the name of the time period variable `prodID` character string for the name of the product ID column `method` character string for the indicator method. Valid options are "laspeyres", "paasche", "bennet", or "montgomery". `sample` whether to use a matched sample (sample = "matched")

## Value

an nx1 matrix containing the indicator

## Examples

 ```1 2 3``` ```# compute a price indicator using the Montgomery method priceIndicator(CES_sigma_2, pvar = "prices", qvar = "quantities", prodID = "prodID", pervar = "time", method = "montgomery") ```

### Example output

```             [,1]
[1,]          NA
[2,] -1.27874802
[3,]  2.23764163
[4,]  0.37329461
[5,] -2.35138599
[6,]  3.23912451
[7,] -0.66571059
[8,] -2.74535253
[9,]  2.45168559
[10,] -2.28761791
[11,]  2.85483403
[12,]  0.08391295
```

IndexNumR documentation built on Feb. 7, 2022, 5:09 p.m.