Calculation of variance/sigma squared for price index
CalcIndS2.Rd
Calculation of sigma squared for a price index.
Usage
CalcIndS2(data, baseVar, pVar, groupVar, type = c("carli", "dutot", "jevons"))
Arguments
- data
The dataset
- baseVar
The variable name for the base goods price.
- pVar
The variable name for the goods price.
- groupVar
The variable used for grouping observations - sometimes called the elementary group
- type
The type of index to calculate. Choose from: 'carli', 'dutot', 'jevons'
Value
- s2
sigma squred values for each strata group
- ai
adjustment factor used in calculations
- zmat
Matrix of z values which can be used to check for outliers
Examples
{
# Call in test dataset for an index
data(priceData)
# Calculate s2 for an index
ss <- CalcIndS2(data = priceData, baseVar = "b1", pVar = "p1", groupVar = "varenr",
type = "carli")
ss <- CalcIndS2(data = priceData, baseVar = "b1", pVar = "p1", groupVar = "coicop",
type = "jevons")
# print out s2 values
ss$s2
}
#> 1 2 3 4 5 6
#> 0.001978245 0.001990785 0.002007839 0.002246234 0.001714990 0.001735577
#> 7 8 9 10
#> 0.002014489 0.002415221 0.002093395 0.001990386