Calculate Within Shares for Subnest Structure

gen_subnest_share(df, mkt_share, market_id, nest_id, subnest_id)

Arguments

df

Dataframe to work with

mkt_share

Variable containing product market shares, as a character string.

nest_id

Variable containing market share of nest, as a character string.

subnest_id

Variable containing market share of subnest, as a character string.

Value

A dataframe with the outside- and nest-shares added.