I’m trying to run a code from a paper as part of my analysis, following the steps in a research paper. First, I estimate a model to get the firm effects and errors. Then, in Step 2, I use the frontier command to model the inefficiency on the compustat data.
When I run this code, I get this error:
To fix this, I tried modifying the command like this:
My questions:
Thanks!
Code:
gen sales_stock = ln(sale) gen sga_stock = ln(xsga) gen goodwill_stock = ln(gdwl) * Changes made here: rename fyear year destring gvkey, replace force duplicates drop gvkey year, force encode sic, gen(_sic) drop sic rename _sic sic * Define the stochastic frontier model using maximum likelihood estimation xtset gvkey year * step1 : xtreg sales_stock sga_stock goodwill_stock i.sic, re predict alp , u /* Obtain estimates of alpha( time-invariant firm effect) */ predict esl , e /* Obtain estimates of the composed error */ * step 2: // frontier alp , distribution ( hnormal ) frontier alp predict ineff_pers , u /* Predict persistent inefficiency , E(u|e) */ predict eff_pers , te /* Predict persistent efficiency , E(exp ( -u)|e) */ * step 3: // frontier esl , distribution ( hnormal ) frontier esl /* This line creates the error */ predict ineff_trans , u /* Predict transitory inefficiency , E(u|e) */ predict eff_trans , te /* Predict transitory efficiency , E(exp ( -u)|e) */ gen MC=ineff_pers*ineff_trans
Code:
. frontier esl initial values not feasible r(1400);
Code:
frontier esl sales_stock sga_stock goodwill_stock, distribution(hnormal)
- Am I using the frontier command correctly in Step 2?
- Should I include variables like sales_stock, sga_stock, and goodwill_stock when working with esl?
Thanks!
Comment