compute_outside_share: Compute Share of Outside Good

Description Usage Arguments Value Examples

View source: R/create_shares.R

Description

Compute Share of Outside Good

Usage

1
compute_outside_share(df, mkt_share, market_id)

Arguments

df

Dataframe to work with

mkt_share

Variable containing product market shares, as a character string.

market_id

List of variables contaning market identifiers

Value

A dataframe with the variable outside_share added as a column.

Examples

1
2
3
4
5
6
# Add Outside Share column to data
mkts <- create_markets(geog_id = "market_id", time_id = "year")
df   <- mkt_share_from_sales(eurocars,
                               quantity   = 'qty_sold',
                               population = 'population')
df2  <- compute_outside_share(df, mkt_share = 'mkt_share', market_id = mkts)

lachlandeer/demandr documentation built on May 21, 2019, 12:04 p.m.