Package 'IndexNumber'

Title: Index Numbers in Social Sciences
Description: We provide an R tool for teaching in Social Sciences. It allows the computation of index numbers. It is a measure of the evolution of a fixed magnitude for only a product of for several products. It is very useful in Social Sciences. Among others, we obtain simple index numbers (in chain or in serie), index numbers for not only a product or weighted index numbers as the Laspeyres index (Laspeyres, 1864), the Paasche index (Paasche, 1874) or the Fisher index (Lapedes, 1978).
Authors: Alejandro Saavedra-Nieves, Paula Saavedra-Nieves
Maintainer: Alejandro Saavedra-Nieves <[email protected]>
License: GPL-2
Version: 1.3.2
Built: 2024-10-31 22:09:37 UTC
Source: CRAN

Help Index


Index Numbers in Social Sciences

Description

We provide an R tool for teaching in Social Sciences. It allows the computation of index numbers. It is a measure of the evolution of a fixed magnitude for only a product of for several products. It is very useful in Social Sciences. Among others, we obtain simple index numbers (in chain or in serie), index numbers for not only a product or weighted index numbers as the Laspeyres index (Laspeyres, 1864), the Paasche index (Paasche, 1874) or the Fisher index (Lapedes, 1978).

Details

The DESCRIPTION file:

Package: IndexNumber
Type: Package
Title: Index Numbers in Social Sciences
Version: 1.3.2
Date: 2021-03-15
Author: Alejandro Saavedra-Nieves, Paula Saavedra-Nieves
Maintainer: Alejandro Saavedra-Nieves <[email protected]>
Description: We provide an R tool for teaching in Social Sciences. It allows the computation of index numbers. It is a measure of the evolution of a fixed magnitude for only a product of for several products. It is very useful in Social Sciences. Among others, we obtain simple index numbers (in chain or in serie), index numbers for not only a product or weighted index numbers as the Laspeyres index (Laspeyres, 1864), the Paasche index (Paasche, 1874) or the Fisher index (Lapedes, 1978).
License: GPL-2
LazyData: true
RoxygenNote: 7.0.2
NeedsCompilation: no
Packaged: 2021-03-15 10:31:20 UTC; alexs
Repository: CRAN
Date/Publication: 2021-03-15 12:30:03 UTC

Index of help topics:

ActivePeople            Economically active people in Spain from 2002
                        to 2019.
ECResources             Combustibles and energy resources for the main
                        home in Spain from 2006 to 2015.
Food                    Food in Spain from 2006 to 2015.
IndexNumber-package     Index Numbers in Social Sciences
Mortgages               Mortgages constituted on urban properties in
                        Spain from 2003 to 2018.
aggregated.index.number
                        Calculate an aggregate index number
edgeworth.index.number
                        Calculate the Edgeworth index number
fisher.index.number     Calculate the Fisher index number
index.number.chain      Calculate an index number in chain
index.number.serie      Calculate an index number in serie
laspeyres.index.number
                        Calculate the Laspeyres index number
paasche.index.number    Calculate the Paasche index number

Once we have defined a magnitude for a product (of several products), we can analyse how it (they) evolves along the time. Index Numbers model this effect in Social Science. In this sense, several approaches may be considered. We include in this package several options of analysing this problem.

Author(s)

Alejandro Saavedra-Nieves, Paula Saavedra-Nieves

Maintainer: Alejandro Saavedra-Nieves <[email protected]>

References

- (2004) Consumer Price Index Manual: Theory and Practice. ILO, IMF. CPI Manual OECD, UN, Eurostat, and The World Bank by ILO, Geneva.

Index Number (2008) In: The Concise Encyclopedia of Statistics. Springer, New York, NY. <doi:https://doi.org/10.1007/978-0-387-32833-1>.

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

Paasche, H. (1874) Uber die Preisentwicklung der letzten Jahre nach den Hamburger Borsen-notirungen. Jahrb. Natl. Stat. 23, 168–178.

Examples

prices<-c(70,75,77,77,85,90,85,75,77,87,85,90,70,75,77,77,85,90)
index.number.serie(prices,name="Prices",opt.plot=TRUE,opt.summary=TRUE)

Economically active people in Spain from 2002 to 2019.

Description

Number (thousands) of economically active women and men in Spain between 2002 and 2019

Usage

data(ActivePeople)

Format

A data frame with columns:

Time

A trimester (T1, T2, T3 and T4) between 2002 and 2019.

TotalWomen

Number (thousands) of economically active women.

TotalMen

Number (thousands) of economically active men.

Source

Spanish Statistical Office (INE), http://www.ine.es

Examples

## Not run: 
 ActivePeople

## End(Not run)

Calculate an aggregate index number

Description

This function determines index numbers without weights for those cases in which there exist more than an only product (in chain or in serie)

Usage

aggregated.index.number(x, base, type, 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.

base

Chain of characters that indicates the nature of the index number. If we introduce base="serie", we compare each value with respect to the initial one. In this case, it is said to be an index number in serie. Otherwise, if we introduce base="chain", we obtain the index number in chain, by comparing each value with the immediately previous value.

type

Chain of characters to indicate the type of non-weighted index number to evaluate the evolution of a set of magnitudes (even for different products).

By considering base="serie", if we introduce type="arithmetic", we obtain the Sauerbeck index number. If we introduce type="geometric", we obtain the Geometric index. If we choose type="harmonic", we obtain the Harmonic mean index. If we write type="BDutot", we will obtain the Bradstreet-Dutot index.

Otherwise, if we take base="chain" and type="Carli", we obtain the Carli index number. If we introduce type="Jevons", we obtain the Jevons index and if we choose type="Dutot", we obtain the Dutot index.

name

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

opt.plot

Logical option to indicate if a graphical description 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.

Author(s)

A. Saavedra-Nieves, P. Saavedra-Nieves

References

CPI Manual (2004). Consumer Price Index Manual: Theory and Practice. OECD, UN, Eurostat, and TheWorld Bank by ILO, Geneva.

Index Number (2008). In: The Concise Encyclopedia of Statistics. Springer, New York, NY. <doi:https://doi.org/10.1007/978-0-387-32833-1>

Examples

prices<-matrix(c(70,75,77,77,85,90,85,75,77,87,85,90,70,75,77,77,85,90),ncol=3)
aggregated.index.number(prices,"chain","geometric","Price",opt.plot=TRUE,opt.summary=TRUE)

Combustibles and energy resources for the main home in Spain from 2006 to 2015.

Description

Unitary value (euros) and consumed amount (thousands of units) of combustibles and other energy resources for the main home in Spain from 2006 to 2015.

Usage

data(ECResources)

Format

A data frame with columns:

Time

Year between 2006 and 2015.

ElectricityPrice

Unitary value of electricity (KWh).

NaturalGasPrice

Unitary value of natural gas (m3).

LiquifiedGasPrice

Unitary value of liquified gas (kilo).

LiquifiedCombustiblesPrice

Unitary value of liquified combustibles (l).

SolidCombustiblesPrice

Unitary value of Solid combustibles(l).

ElectricityConsumed

Consumed (thousands of units) of electricity (KWh).

NaturalGasConsumed

Consumed (thousands of units) of natural gas (m3).

LiquifiedGasConsumed

Consumed (thousands of units) of liquified gas (kilo).

LiquifiedCombustiblesConsumed

Consumed (thousands of units) of liquified combustibles (l).

SolidCombustiblesConsumed

Consumed (thousands of units) of solid combustibles (l).

Source

Spanish Statistical Office (INE), http://www.ine.es

Examples

## Not run: 
 ECResources

## End(Not run)

Calculate the Edgeworth index number

Description

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

Usage

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

Arguments

x

Matrix that contains the magnitude(s) under study. In each column, it contains the magnitude of a different product considered. Thus, we have nrow(x) values of a magnitude for ncol(x) products.

y

Matrix that contains that magnitude used as weight. In each column, it contains another magnitude associated to each different product along the time. Thus, we have nrow(x) values of magnitudes for the set of 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.

Author(s)

A. Saavedra-Nieves, P. Saavedra-Nieves

References

Edgeworth, F. (1887) Measurement of change in value of money i. First Memorandum presented to the British Association for the Advancement of Science. Reprinted in his Papers Relating to Political Economy, 1, 198–259.

Marshall, A. (1887) Remedies for fluctuations of general prices. The Contemporary review, 1866-1900, 51, 355–375.

Examples

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)
edgeworth.index.number(prices,weights,"Price",opt.plot=TRUE,opt.summary=TRUE)

Calculate the Fisher index number

Description

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

Usage

fisher.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.

Author(s)

A. Saavedra-Nieves, P. Saavedra-Nieves

References

Fisher, I. (1922) The making of index numbers: a study of their varieties, tests, and reliability, volume 1. Houghton Mifflin.

Lapedes, Daniel N. (1978) Dictionary of Physics and Mathematics. McGrow–Hill. p. 367. ISBN 0-07-045480-9.

Examples

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)
fisher.index.number(prices,weights,name="Price",opt.plot=TRUE,opt.summary=TRUE)

Food in Spain from 2006 to 2015.

Description

Unitary value (euros) and consumed amount (thousands of units) of food in Spain from 2006 to 2015.

Usage

data(Food)

Format

A data frame with columns:

Year

Year from 2006 and 2015.

RicePrice

Unitary value of rice (kilo).

BreadPrice

Unitary value of bread (kilo).

PorkPrice

Unitary value of pork meat (kilo).

FishPrice

Unitary value of fish (kilo).

WholeMilkPrice

Unitary value of whole milk (l).

EggsPrice

Unitary value of eggs (unit).

OliveOilPrice

Unitary value of olive oil (l).

ApplesPrice

Unitary value of apples (kilo).

DriedFruitAndNutsPrice

Unitary value of dried fruit and nuts (kilo).

GreenVegetablePrice

Unitary value value of green vegetables (kilo).

PotatoesPrice

Unitary value value of potatoes (kilo)

SugarPrice

Unitary value value of sugar (kilo)

ChocolatePrice

Unitary value value of chocolate (kilo)

CoffeePrice

Unitary value value of coffee (l).

MineralWaterPrice

Unitary value value of mineral water (l).

WinePrice

Unitary value value of wine (l).

BeerPrice

Unitary value value of beer (l).

RiceConsumed

Total amount (thousands of units) of consumed rice (kilo).

BreadConsumed

Total amount (thousands of units) of consumed bread (kilo).

PorkConsumed

Total amount (thousands of units) of consumed pork meat (kilo).

FishConsumed

Total amount (thousands of units) of consumed fish (kilo).

WholeMilkConsumed

Total amount (thousands of units) of consumed whole milk (l).

EggsConsumed

Total amount (thousands of units) of consumed eggs (unit).

OliveOilConsumed

Total amount (thousands of units) of consumed olive oil (l).

ApplesConsumed

Total amount (thousands of units) of consumed apples (kilo).

DriedFruitAndNutsConsumed

Total amount (thousands of units) of consumed dried fruit and nuts (kilo).

GreenVegetableConsumed

Total amount (thousands of units) of consumed green vegetables (kilo).

PotatoesConsumed

Total amount (thousands of units) of consumed potatoes (kilo)

SugarConsumed

Total amount (thousands of units) of consumed sugar (kilo)

ChocolateConsumed

Total amount (thousands of units) of consumed chocolate (kilo)

CoffeeConsumed

Total amount (thousands of units) of consumed coffee (l).

MineralWaterConsumed

Total amount (thousands of units) of consumed mineral water (l).

WineConsumed

Total amount (thousands of units) of consumed wine (l).

BeerConsumed

Total amount (thousands of units) of consumed beer (l).

Source

Spanish Statistical Office (INE), http://www.ine.es

Examples

## Not run: 
 Food

## End(Not run)

Calculate an index number in chain

Description

This function determines index numbers “in chain” for those cases with an only product.

Usage

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

Arguments

x

It is a vector containing that magnitude to be studied for a product. Thus, we have length(x) values of it.

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.

Index number

Table containing the values of the index number for the considered stages.

Graphical

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

Author(s)

A. Saavedra-Nieves, P. Saavedra-Nieves

References

Index Number (2008) In: The Concise Encyclopedia of Statistics. Springer, New York, NY. <doi:https://doi.org/10.1007/978-0-387-32833-1>.

Examples

prices<-c(70,75,77,77,85,90,85,75,77,87,85,90,70,75,77,77,85,90)
index.number.chain(prices,"Prices",opt.plot=TRUE,opt.summary=TRUE)

Calculate an index number in serie

Description

This function determines index numbers “in serie” for those cases with an only product.

Usage

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

Arguments

x

It is a vector containing that magnitude to be studied for a product. Thus, we have length(x) values of it.

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.

Index number

Table containing the values of the index number for the considered stages.

Graphical

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

Author(s)

A. Saavedra-Nieves, P. Saavedra-Nieves

References

Index Number (2008). In: The Concise Encyclopedia of Statistics. Springer, New York, NY. <doi:https://doi.org/10.1007/978-0-387-32833-1>

Examples

prices<-c(70,75,77,77,85,90,85,75,77,87,85,90,70,75,77,77,85,90)
index.number.serie(prices,"Prices",opt.plot=TRUE,opt.summary=TRUE)

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

Matrix that contains the magnitude(s) under study. In each column, it contains the magnitude of a different product considered. Thus, we have nrow(x) values of a magnitude for ncol(x) products.

y

Matrix that contains that magnitude used as weight. In each column, it contains another magnitude associated to each different product along the time. Thus, we have nrow(x) values of magnitudes for the set of 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.

Author(s)

A. Saavedra-Nieves, P. Saavedra-Nieves

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

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)

Mortgages constituted on urban properties in Spain from 2003 to 2018.

Description

Number of mortgages constituted on urban properties and mortgages amounts (thousands of euros) from 2003 to 2018.

Usage

data(Mortgages)

Format

A data frame with columns:

Year

Year from 2003 to 2018

Number.of.bank.mortgages

Numbers of bank mortages.

Amount.of.bank.mortgages

Amount (thousands of euros) of bank mortages.

Number.of.savings.bank.mortgages

Numbers of savings bank mortages.

Amount.of.savings.bank.mortgages

Amount (thousands of euros) of savings bank mortages.

Number.of.other.entities.mortgages

Numbers of other entities mortages.

Amount.of.other.entities.mortgages

Amount (thousands of euros) of other entities mortages.

Source

Spanish Statistical Office (INE), http://www.ine.es

Examples

## Not run: 
 Mortgages

## End(Not run)

Calculate the Paasche index number

Description

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

Usage

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

Arguments

x

Matrix that contains the magnitude(s) under study. In each column, it contains the magnitude of a different product considered. Thus, we have nrow(x) values of a magnitude for ncol(x) products.

y

Matrix that contains that magnitude used as weight. In each column, it contains another magnitude associated to each different product along the time. Thus, we have nrow(x) values of magnitudes for the set of 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.

Author(s)

A. Saavedra-Nieves, P. Saavedra-Nieves

References

Paasche, H. (1874) Uber die Preisentwicklung der letzten Jahre nach den Hamburger Borsen-notirungen. Jahrb. Natl. Stat. 23, 168–178.

Examples

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)
paasche.index.number(prices,weights,"Price",opt.plot=TRUE,opt.summary=TRUE)