Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • New on SSC - markupest - module for markup estimation

    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))

  • #2
    Hello Gabrielle,

    as using a second state variable (e.g. age) does not seem to work in 'markupest', I want to ask whether it possible in prodest to get the firm-level marginal effects of the inputs of a translog production function?

    For instance, the post-estimation command 'predict, parameters' simply provides the means, as far as I've seen in the source code. But to compute the markups by the framework of De Loecker & Warzynski, I need the firm-level marginal effects.

    However, when I compute them manually and take their means, my means differ from yours. Thus, you must do something different to me.

    prodest valueadded_real_log, free(log_l) state(log_k age) proxy(log_m) met(lp) poly(4) att acf valueadded translog opt(nm) reps(10) id(id_new) t(year)
    predict, parameters


    and mine:

    gen coef_logK = _b[log_k]
    gen coef_logL = _b[log_l]
    gen coef_A = _b[age]
    gen coef_logK_sq = _b[var_2_2]
    gen coef_logL_sq = _b[var_1_1]
    gen coef_A_sq = _b[var_3_3]
    gen coef_logK_logL = _b[var_1_2]
    gen coef_logK_A = _b[var_2_3]
    gen coef_logL_A = _b[var_1_3]

    gen effect_K = coef_logK + 2 * coef_logK_sq * log_k + coef_logK_logL * log_l + coef_logK_A * age if productivity_LPACF3_`lev' != .
    gen effect_L = coef_logL + 2 * coef_logL_sq * log_l + coef_logK_logL * log_k + coef_logL_A * age if productivity_LPACF3_`lev' != .
    gen effect_A = coef_A + 2 * coef_A_sq * age + coef_logK_A * log_k + coef_logL_A * log_l if productivity_LPACF3_`lev' != .
    drop coef_*

    tabstat effect_K effect_L effect_A, stat(mean median)

    I trust your stata-coding skills more than mine. Thus, I want to ask whether it is possible to get the firm-level marginal effects, such that I can correct one with the corresponding input share (e.g. labour)?

    best




    Comment


    • #3
      Dear Philipp,

      thanks for pointing the issue in the state() variables option of markupest - that is, I did not mean to prevent the user from using two or more variables, and be sure to correct this in the next issue of the command!

      As for your specific question, I am unable to reproduce your issue, and confirm that your code is in fact correct: I suspect that you are using an old version of prodest (more specifically, probably the penultimate version of its predict), which was bugged when dealing with ACF+translog models. I enclose a dofile that reproduces yours on prodest example data - and that works pretty smoothly with the latest version.

      I hope to have clarified,

      Gabriele
      Attached Files

      Comment


      • #4
        Oh, yes. Thx a lot.

        Comment


        • #5
          Hello Gabrielle, I have a question about the code.
          In line 73 of the prodest_p_m.ado file, you have written "qui g `alpha' = exp(`inputvar') / exp(`val') // share is input cost / value added". If the inputvar were the logarithm of the number of employees, the alpha would miss the price of labor. It would lead to inconsistencies between the share of labor input and the actual share of labor input of the enterprise. In another word, in the example you write " markupest mkupD3_m1_t_corr, method(dlw) output(lny) inputvar(lnl) free(lnl) state(lnk) proxy(lnm1) prodestopt("poly(3) acf trans va") corrected verbose". What's the meaning of the lnl in your example? This confuses me very much.
          Is it possible to include a variable to record the variable input recorded by the enterprise in value, and exclude the variable input counted by quantity (e.g. number of equipment, number of people). This allows the variable input share expressed in value to be calculated.

          Comment


          • #6
            Originally posted by He Weidong View Post
            Hello Gabrielle, I have a question about the code.
            In line 73 of the prodest_p_m.ado file, you have written "qui g `alpha' = exp(`inputvar') / exp(`val') // share is input cost / value added". If the inputvar were the logarithm of the number of employees, the alpha would miss the price of labor. It would lead to inconsistencies between the share of labor input and the actual share of labor input of the enterprise. In another word, in the example you write " markupest mkupD3_m1_t_corr, method(dlw) output(lny) inputvar(lnl) free(lnl) state(lnk) proxy(lnm1) prodestopt("poly(3) acf trans va") corrected verbose". What's the meaning of the lnl in your example? This confuses me very much.
            Is it possible to include a variable to record the variable input recorded by the enterprise in value, and exclude the variable input counted by quantity (e.g. number of equipment, number of people). This allows the variable input share expressed in value to be calculated.
            I have another doubt about the above question. If variable production inputs are electricity or intermediate inputs, then output is grossoutput. If the Wooldridge method is used, the output cannot be corrected. If ACF is used, the coefficients cannot be estimated correctly. So if I use variable inputs that are not labor, I can only use op or lp methods, and can't use translog. I don't know if I have a misunderstanding of the code, can you share an estimated code that uses materials, etc. as variable inputs?

            Comment


            • #7
              Dear @Gabriele Rovigatti,

              Thank you for introducing prodest.

              I am going to estimate TFP. When I run for the whole industry, it works. But I need to run for each industry separately. This code (below) does not work. Actually, it just creates missing values. Could you please explain what would be the issue with that? I do not assume that -prodest is not compatible with --for each --

              Code:
              xtset NPC_FIC year
              gen tfp_lp_output=.
              
              set more off 
              local indus "10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 41 42 43 45 46 47 55 56 62 63 68 69 70 71 72 73 74 75 78 79 80 81 82"
              
              foreach industry of local indus{
                     di " `industry' "
                    prodest log_y  if CAE_2==`industry', free (log_lab) state (log_k) proxy ( lnmaterials) va met (lp) att reps (50) id (NPC_FIC) t(year)
                    predict out_lp, resid
                    replace tfp_lp_output=ln(out_lp) 
                    drop out_lp
              }
              Thank you so much.
              Cheers,
              Paris

              Comment


              • #8
                Originally posted by Paris Rira View Post
                Dear @Gabriele Rovigatti,

                Thank you for introducing prodest.

                I am going to estimate TFP. When I run for the whole industry, it works. But I need to run for each industry separately. This code (below) does not work. Actually, it just creates missing values. Could you please explain what would be the issue with that? I do not assume that -prodest is not compatible with --for each --

                Code:
                xtset NPC_FIC year
                gen tfp_lp_output=.
                
                set more off
                local indus "10 11 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 41 42 43 45 46 47 55 56 62 63 68 69 70 71 72 73 74 75 78 79 80 81 82"
                
                foreach industry of local indus{
                di " `industry' "
                prodest log_y if CAE_2==`industry', free (log_lab) state (log_k) proxy ( lnmaterials) va met (lp) att reps (50) id (NPC_FIC) t(year)
                predict out_lp, resid
                replace tfp_lp_output=ln(out_lp)
                drop out_lp
                }
                Thank you so much.
                Cheers,
                Paris
                I think there is a problem with the "att" option in your command. You can drop it or you can rewrite this command "cap prodest log_y if CAE_2==`industry', free (log_lab) state (log_k) proxy ( lnmaterials) va met (lp) att reps (50) id (NPC_FIC) t(year)". (add cap before prodest). I think your problem will be solved

                Comment


                • #9
                  You must use a translog function if you want to conduct an intersectional analysis. When you use a simple CD function, you assume that the elasticity of input is the same for all sectors.You must use a translog function if you want to conduct an intersectional analysis. When you use a simple CD function, you assume that the elasticity of input is the same for all sectors. elasticity of input is the same for all sectors

                  Comment

                  Working...
                  X