p_laspeyre: Laspeyre price index.

View source: R/building_blocks.R

p_laspeyreR Documentation

Laspeyre price index.

Description

The Laspeyre price index calculated as

\frac{∑_i p^t_i q^b_t}{∑_i p^b_i q^b_i}.

Arguments can either be vectors or matrices.

Usage

p_laspeyre(pt, pb, qb)

Arguments

pt

A n-vector (or m x n matrix) of prices in current period.

pb

A n-vector (or m x n matrix) of prices in the baseline period.

qb

A n-vector (or m x n matrix) of quantities in the baseline period.

Value

Price index between current an baseline period (number or vector).

Examples

Pt <- matrix(1:6, ncol = 2)
Pb <- Pt*0.7
Qb <- matrix(2:7, ncol = 2)
p_laspeyre(Pt, Pb, Qb)
p_laspeyre(Pt[1,], Pb[1,], Qb[1,])

ErikOSorensen/pppindexr documentation built on Jan. 7, 2023, 4:11 p.m.