Announcement

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

  • Originally posted by Meng Song View Post
    Dear Gabriele, may I ask why prodest generate much smaller number of ACF productivity than other methods like Levinsohn and Petrin and Wooldridge, please? The variables I'm using to generate these three versions of productivity are exactly the same, but L&P and Wooldridge methods give many more predicted productivity than the ACF version. Could you enlighten me, please? The version of prodes I use is the newest version, but I couldn't figure this out. Thank you very much.

    * Levinsohn and Petrin method

    * using turnover
    gen prodest_lp_rev = .

    foreach i of numlist 10(1)43 {
    capture {
    prodest lr if nace2 == `i', free(ll) state(lk) proxy(lm) met(lp) opt(dfp) reps(50) id(id) t(year)
    predict temp if e(sample), resid
    replace prodest_lp_rev = temp if nace2 ==`i'
    drop temp
    }
    }

    label var prodest_lp_rev "Prodest produced Levinsohn and Petrin method productivity, revenue"


    * ACF

    * using turnover
    gen prodest_acf_rev = .

    foreach i of numlist 10(1)43 {
    capture {
    prodest lr if nace2 == `i', free(ll) state(lk) proxy(lm) met(lp) acf opt(dfp) reps(50) id(id) t(year)
    predict temp if e(sample), resid
    replace prodest_acf_rev = temp if nace2 ==`i'
    drop temp
    }
    }

    label var prodest_acf_rev "Prodest produced Ackerberg, Caves and Frazer correction productivity, revenue"
    Dear Meng,

    without looking at the data, I am unable to provide a definitive answer. For the time being, I can only say that ACF method is well-known for having computational issues (see the dedicated chapter in prodest companion paper on the Stata Journal or the Kim et al., 2019 paper on JAE) and that this might drive the difference in your results.

    In case that might help you, you can send me an email with the data and a reproducible example at [email protected]

    Best,

    Gabriele

    Comment


    • Dear Gabriele, thank you very much for your prompt reply. I've sent the data and do-file to your gmail account. Could you help me identify what may go wrong, please? Also, for the two papers, I've got "Theory and practice of total-factor productivity estimation: The control function approach using Stata" in 2018. What's the title for the Kim et al 2019 paper, please? I'm not sure I've found this. Many thanks indeed.

      Comment


      • Dear Gabriele,

        (1) I was wondering, under translog, how exactly does the "predict, parameters" estimate the input elasticity. Is it just an unweighted average of all the (beta_l+ 2*beta_ll*l + beta_lk*k) .And
        (2) I was planning to loop over each industry, estimate the industry-level input elasticity under translog, and record the estimated industry-level input elasticity. However I could not locate the actual elasticity estimates as a number, as the "predict, parameters" seems to return a table.

        Here is the code i tried:

        egen industry_group = group(industry)
        su industry_group, meanonly

        g input_elas = .
        forv g = 1/`r(max)' #total number of distinct industry groups#{
        tempvar input_elas`g'
        prodest log_y if industry_group == `g', free(log_lab) state(log_k) proxy(log_material) va met(wrdg) reps(50) id(id) t(closing_year) trans
        predict `input_elas`g'', parameters
        replace input_elas = `input_elas`g'' if group == `g'
        }

        Can you provide some insights on how I could record the input elasticity in my loop?

        Thank you!

        Comment


        • Dear Gabriele,

          Thank you very much for this package! Very useful and insightful! I have downloaded it and I am looking forward to use it.

          I would one question (pardon me if it is a stupid one). If my ultimate goal is to compute TFP, then I would simply compute TFP=Y-BetaK*K-BetaL*L, where BetaK and BetaL are the estimated coefficients. Is this right? Or would it be better to predict it, as per some earlier posts?

          Thank you so much!

          Best,

          Sara

          Comment


          • ciao

            Comment


            • i need urgently to replicate a figure and I have created the following codes for shares within sectors, and within sectors by year and by size.
              levelsof Sector, local (sector)
              levelsof size, local(Size)
              foreach x of local sector {
              foreach y of local Size {
              egen tot_`x'=total(L) if Sector==`x'
              egen tot_`x'_`y'=total(L) if Sector==`x' & size==`y'
              egen share_`x'_`y'=tot_`x'/tot_`x'_`y'

              }

              }

              Comment


              • i need urgently to replicate a figure and I have created the following codes for shares within sectors, and within sectors by year and by size.
                levelsof Sector, local (sector)
                levelsof size, local(Size)
                foreach x of local sector {
                foreach y of local Size {
                egen tot_`x'=total(L) if Sector==`x'
                egen tot_`x'_`y'=total(L) if Sector==`x' & size==`y'
                egen share_`x'_`y'=tot_`x'/tot_`x'_`y'

                }

                }

                levels of Sector, local(sectors)
                forvalues i=2011 2020 {
                foreach l of local sectors {
                levelsof Size if Sector==`"`l'"', local(sizes)
                foreach s of local sizes {
                egen count_tot_`l'=total(L) if Sector==`"`l'"' & y==`i'
                egen count_tot_`s'_`l'=total (L) if Sector==`"`l'"' & Size==`"`s'"'
                egen share_`i'_`l'=count_tot_`s'_`l'/count_tot if Sector==`"`l'"'
                }
                }
                }




                Comment


                • Dear Gabriele Rovigatti Giorgio Presidente ,

                  I am trying to estimate the TFP using prodest command by sector (with LP method)

                  Here is my command :

                  levelsof sector,local(sect)
                  foreach var of local sect {
                  prodest lva if sect=="`var'", free(ls lu) proxy(linput) state (lk) valueadded met(lp)
                  predict tfp_`var' ,resid
                  }

                  Actually, I have 2 questions

                  1. If I run this command, I found that the new variable predicted tfp_sect is created for all sectors and not only when sect=="`var'". Would you please advice at this point?

                  So, I changed my command to the followwing

                  levelsof sect,local(sect)
                  foreach var of local sect {
                  prodest lva if sect=="`var'", free(ls lu) proxy(linput) state (lk) valueadded met(lp)
                  predict tfp_`var' if sect=="`var'" ,resid
                  }

                  gen tfp_sector=.
                  levelsof sect,local(sect)
                  foreach var of local sect{
                  replace tfp_sector=tfp_`var' if sect=="`var'"
                  }
                  2. I got an error message 'too many variables'. I have 13 sectors. Why I can't run the command.

                  Thanks in advance,
                  Aya
                  Last edited by Aya Elewa; 06 Apr 2023, 03:35.

                  Comment


                  • Originally posted by Gabriele Rovigatti View Post
                    Dear Riandy,

                    I copy/paste below the answer to Donghan sent directly to him by email


                    Dear Gabriele,

                    Thanks for the helpful command and also for also further improvements you have added to it, and also the introduction of the markupest command. Really useful!!
                    I saw that this question regarding reproducibility is quite recurrent when the command uses the acf correction. The code I am trying to run is the following:

                    prodest lny, free(lnl) state(lnk) proxy(lnm1) poly(3) acf trans va id(firm) t(period) fsresiduals(resids)

                    However, and as said by others, if I run it twice I never get the same results. Your recommendation to fix the issue is to use a different optimizer or set the seed to ensure reproducibility. However, I tried including seed(integer_value) in my code and I got the error: "option seed() not allowed". Also, how would you determine this value?
                    For the optimizers, is there one that would lead to more "stable" results? As you may understand is not ideal to have different results each time the command is running.

                    In any case, after I estimate this I use the option available with predict to get the markup estimates (which would be the same as running the markupest but I just to understand the steps behind the estimation process). Is it reasonable that I obtain negative markups? Even by trimming the outliers of the density at 5% I still get negative results.

                    All help is very welcome!!!
                    Thanks in advance,
                    Inês

                    PS: Also anyone who may have knowledge on this topic is very welcome to contribute and share ideas (feel free to contact me directly at [email protected])

                    Comment


                    • Dear Ines,

                      as you mentioned, the issue with ACF is well-known and reproducibility is only obtainable if you set the seed before running the estimation (something like
                      Code:
                      set seed <integer>
                      before running prodest. The value of integer does not matter in this case. Second, I do not find any optimizer that is more stable than the others: it really depends on the case at hand. Negative values of the estimated markups are possible, and empirically I can confirm that this happens (also at the aggregated value, see e.g. Hall, 2018), but it is most likely due to measurement error. In case you are using messy or not-so-clean data (as balance-sheet data usually are) I would not recommend to use a translog production function, as long as poorly estimated cross-terms might add noise to your estimates.

                      I hope to have clarified,

                      Gabriele

                      Comment


                      • Dear Gabriele,

                        Thanks a lot for your answer and sorry for the late reply! I tried to set the seed before running prodest and if I always use that seed I get the same results. However, the issue is that I will end up with different values of markup estimates for different seed values. So the value of the integer actually matters as it changes my final markup estimates. I thought it could be related to the number of repetitions of the command, so I also increased that to 500 (instead of relying on the standard 5).
                        I tried to think of a way of solving this issue, or the "correct" integer value to set the seed to, but without success.

                        What I did was:
                        set seed integer
                        prodest ln_valueadded if sector=="Sector A", free(ln_labor) state(ln_capital) proxy(ln_materials) reps(500) poly(3) acf trans va fsresiduals(resids)
                        predict mkup_sectorA, markups inputvar(ln_labor) corrected

                        So for example for integer=998877 my mkup_sectorA estimates vary between 0.2296 and 27.8129 (mean=1.5988) and if I consider integer=3517381 my mkup_sectorA estimates vary between -64.7598 and 29.8147 (mean=2.5596).

                        Do you have any suggestions on how to proceed in this case?

                        Thanks in advance,
                        Inês

                        Comment


                        • Dear Inês,

                          I am afraid that this issue is hardly solvable - as I mentioned in my previous reply, the problem is rather well-known in the empirical literature, and has to do with the optimization of the second-stage problem in ACF. There is no such a thing as a right integer to set the seed, that's simply a "trick" to ensure riproducibility. In addition, increasing bootstrap repetitions is not going to help you, as it only serves to estimate standard errors - not parameters.

                          I see that your estimates vary quite a lot: that could be due to the use of translog in combination with a low number of observations or very noisy data.

                          I am sorry to be unable to help you further,

                          Gabriele

                          Comment


                          • I have a question to consult you. How to control "exit" variable when calculating tfp of Olley-Pakes (OP 1996) using "prodest" instruction?

                            Comment


                            • Dear Fu,

                              you should use the attrition option of prodest.

                              Best,

                              Gabriele

                              Comment


                              • Dear Gabriele

                                I am using the stata program of an external remote system, and the estimation coefficient and standard error are calculated differently every time I use the prodest command. This problem probably occurs because the prodest of the external remote stata is an old version.

                                Perhaps I have to provide and install the latest version of prodest on the external remote computer. To do this, I need to provide the latest version of prodest to the external remote system. How can I get the latest prodest version?

                                Unlike simply installing prodest on my personal computer, I need to provide the latest prodest package to an external remote system. Currently, there are two such packages in prodest of stata help. That is,

                                st0537 from http://www.stata-journal.com/software/sj18-3
                                prodest from http://fmwww.bc.edu/RePEc/bocode/p


                                Which of the two should I install on my personal computer and provide the file in that path to an external remote computer?

                                Please suggest me a solution.

                                I appreciate your quick response.

                                Jaimin Lee


                                Comment

                                Working...
                                X