Compute Share of Outside Good
compute_outside_share(df, mkt_share, market_id)
df | Dataframe to work with |
---|---|
mkt_share | Variable containing product market shares, as a character string. |
market_id | List of variables contaning market identifiers |
A dataframe with the variable outside_share
added as a column.
# 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)