shares: Compute expenditure shares for each product and time period

Description Usage Arguments Value

View source: R/shares.R

Description

Compute expenditure shares for each product and time period

Usage

1
shares(x, pvar, qvar, pervar, prodID)

Arguments

x

A dataframe containing price, quantity, a time period identifier and a product identifier. It must have column names.

pvar

A character string for the name of the price variable

qvar

A character string for the name of the quantity variable. For elementary indexes a quantity variable is not required for the calculations and you must specify qvar = "".

pervar

A character string for the name of the time variable. This variable must contain integers starting at period 1 and increasing in increments of 1 period. There may be observations on multiple products for each time period.

prodID

A character string for the name of the product identifier

Value

an n by p data frame of expenditure shares


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