productChanges: Product ID's for appearing/disappearing products

Description Usage Arguments Value Examples

View source: R/evaluateMatched.R

Description

This function will give the product ID's of products that appear or disappear in each period.

Usage

1
productChanges(x, pervar, prodID)

Arguments

x

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

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

a list containing one element for each time period, each element of which contains two vectors (one for appearing products, and one for disappearing products)

Examples

1
2
3
4
5
# create a dataset with some missing products
df <- CES_sigma_2[-c(3,4,15),]

# show the products that changed
productChanges(df, "time", "prodID")

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