Code:
ssc install markupest
markupest is a new and comprehensive module for micro- and macro-level markup estimation. It implements i) the micro-approach to markup estimation proposed by De Loecker and Warzynski (AER, 2012), and ii) the macro estimation routines proposed by Hall (JPE, 1988), Roeger (JPE, 1995) and Hall (NBER wp, 2018). Its usage builds - but is independent of - the user-contributed module prodest.

Type
Code:
help markupest
for an overview of the available options, features, and examples of its basic usage.

markupest is an ongoing project and the current version is not meant not be definitive. Therefore suggestions, impressions and bug reporting are more than welcome.

Interested readers may refer to the companion working paper here, or to the replication + example code here.

Below I report a usage example (see the replication code or the helpfile to find the relative data).

Code:
/* Micro markups: DLW (2012) */
. use "mkup_example.dta", clear

. xtset f_id year
panel variable:
f_id (unbalanced)
time variable:
delta:
year, 2010 to 2018
1 year
. bys sector: markupest mkupACF_translog, method(dlw) output(ln_va) inputvar(ln_l)
> free(ln_l) state(ln_k) proxy(ln_m) valueadded prodestopt("poly(3) acf trans")
> verbose corr
------------------------------------------------------------------------------
-> sector = 1
------------------------------------------------------------------------------
ln_va |
Coef.
-------------+----------------------------------------------------------------
ln_l | .1644373
ln_k | .3494995
ln_lXln_l | .0990814
ln_lXln_k | -.0459942
ln_kXln_k | -.0025919
------------------------------------------------------------------------------
.
.
------------------------------------------------------------------------------
ln_va |
Coef.
-------------+----------------------------------------------------------------
ln_l | .2154983
ln_k | .2501279
ln_lXln_l | .0746624
ln_lXln_k | -.0399165
ln_kXln_k | .002214
------------------------------------------------------------------------------

/* Run the graphs */
tw (kdensity mkupACF_translog if sector == 1, lw(medthick) lp(_) lc(ebblue))
> (kdensity mkupACF_translog if sector == 2, lw(medthick) lp(-) lc(maroon))
> (kdensity mkupACF_translog if sector == 3, lw(medthick) lp(.-.) lc(forest_green))
> (kdensity mkupACF_translog if sector == 4, lw(medthick) lp(-.-) lc(sand))
> (kdensity mkupACF_translog if sector == 5, lw(medthick) lp(l) lc(navy))
> (kdensity mkupACF_translog if sector == 6, lw(medthick) lp(dot) lc(purple))
> (kdensity mkupACF_translog if sector == 7, lw(medthick) lp(_) lc(olive_teal))
> (kdensity mkupACF_translog if sector == 8, lw(medthick) lp(-) lc(cyan))
> (kdensity mkupACF_translog if sector == 9, lw(medthick) lp(l) lc(ltblue))
> (kdensity mkupACF_translog if sector == 10, lw(medthick) lp(dot) lc(mint))
> (kdensity mkupACF_translog if sector == 11, lw(medthick) lp(_) lc(erose))
> if mkupACF_translog < 3, ytitle("Density") xtitle("Markup") legend(order(
> 1 "25: metal manuf" 2 "41: buildings" 3 "43: sp constr" 4 "45: wholes/retail"
> 5 "49: land transp" 6 "55: accomod" 7 "56: food/beverage" 8 "62: programming"
> 9 "63: inform" 10 "68: real estate" 11 "82: administrative") cols(3))