groupIndexes: Calculate price indexes for product groups

Description Usage Arguments Value Examples

View source: R/groups.R

Description

Calculate price indexes for product groups

Usage

1
groupIndexes(group, indexFunction, indexArgs)

Arguments

group

the name of the variable containing the group ID. This must be a factor variable, or a variable coercible to a factor.

indexFunction

the name of the function to use to calculate the index as a string. Available options are 'priceIndex', 'GEKSIndex', 'GKIndex', 'WTPDIndex'.

indexArgs

arguments for the price index function as a named list. All arguments must be named.

Value

a list of indexes, one for each group

Examples

1
2
3
4
5
6
7
df <- CES_sigma_2
df$groupID <- c(rep(1, 24), rep(2, 24))

argsList <- list(x = df, pvar = "prices", qvar = "quantities", pervar = "time",
prodID = "prodID", indexMethod = "fisher", output = "chained")

groupIndexes("groupID", "priceIndex", argsList)

IndexNumR documentation built on Feb. 7, 2022, 5:09 p.m.