productChanges: Product ID's for appearing/disappearing products

View source: R/evaluateMatched.R

productChangesR Documentation

Product ID's for appearing/disappearing products

Description

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

Usage

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

# 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 Nov. 11, 2023, 1:07 a.m.