Learn R Programming

IndexNumber (version 1.1)

laspeyres.index.number: Calculate the Laspeyres index number

Description

This function determines the Laspeyres index number for those cases in which there exist more than an only product.

Usage

laspeyres.index.number(x, y, name, opt.plot = FALSE, opt.summary = FALSE)

Arguments

x

It is a matrix containing that magnitude to be studied. In each column, it contains the magnitud of a different product. Thus, we have nrow(x) values of a magnitud for ncol(x) products.

y

It is a matrix containing that magnitude used as weight. In each column, it contains another magnitud of the different products along the time. Thus, we have nrow(x) values of a magnitud for ncol(x) products.

name

Chain of characters to indicate the name of the variable under study.

opt.plot

Logical option to indicate if a graphical descriptiony of the index number along the different stages is required. It takes the value TRUE or FALSE.

opt.summary

Logical option to indicate if a statistical summary of the index number is required. It takes the value TRUE or FALSE.

Value

Summary

Statistical summary (optional) of the index number along the considered period.

Agg. index number

Table containing the values of the index number for the considered stages and the aggregate value.

Graphical

Graphical summary (optional) of the index number along the considered period.

References

Laspeyres, E. (1864) Hamburger Warenpreise 1850--1863 und die kalifornisch-australischen Geldentdeckung seit. Jahrb. Natl. Stat. 3, 81--118, 209--236.

Laspeyres, E. (1871) Die Berechnung einer mittleren Waarenpreissteigerung. Jahrb. Natl. Stat. 16, 296--314.

Examples

Run this code
# NOT RUN {
prices<-matrix(c(70,75,77,77,85,90,85,75,77,87,85,90,70,75,77,77,85,90),ncol=3)
weights<-matrix(c(1,1.5,0.8,1.1,1,0.9,0.7,0.8,0.6,1,1.1,0.9,1,1,0.9,1.1,0.6,0.8),ncol=3)
laspeyres.index.number(prices,weights,"Price",opt.plot=TRUE,opt.summary=TRUE)
# }

Run the code above in your browser using DataLab