View source: R/building_blocks.R
q_laspeyre | R Documentation |
The Laspeyre quantity index is calculated as
\frac{∑_i q^t_i p^b_t}{∑_i q^b_i p^b_i}.
Arguments can either be vectors or matrices.
q_laspeyre(pb, qt, qb)
pb |
A n-vector (or m x n matrix) of prices in the baseline period. |
qt |
A n-vector (or m x n matrix) of quantities in the current period. |
qb |
A n-vector (or m x n matrix) of quantities in the baseline period. |
Price index between current an baseline period (number or vector).
Pb <- matrix(1:6, ncol = 2) Qb <- matrix(2:7, ncol = 2) Qt <- Qb * 1.2 p_laspeyre(Pb, Qt, Qb) p_laspeyre(Pb[1,], Qt[1,], Qb[1,])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.