Hello everyone,
I am currently estimating a translog cost function from a unbalanced panel data set by using a stochastic frontier model (sfpanel command).
Code: sfpanel lntc lnglp llnglps lnpe_a lnfe_a lnae_a c.lnglp#c.lnpe_a c.lnglp#c.lnfe_a c.lnglp#c.lnae_a c.llnpe_as#c.llnfe_as c.llnpe_as#c.llnae_as c.llnae_as#c.llnfe_as i.year, model(bc95) dist(tn)
Where lntc is log of total cost, lnglp (log of gross loan portfolio) is my output variable and lnpe, lnfe and lnae are my input prices in log. The other variables are specified according to the formula (see attachment formula (3)) I am using e.g llnglps = 0.5*(lnglp)^2. I get (at least from my understanding good results when I run this. However in my next step I need to calculate the marginal costs for each firm, year observation in my dataset, I tried to use the margins command to calculate the first derivative of my translog cost function with respect to lnglp (my output variable) see also formula (4) in attachment.
Code: margins, dydx(lnglp) gen(MCF)
Now I am wondering if this is correct? Meaning if the command actually takes the derivative to each term where lnglp is involved or only to lnglp itself, as I pre specified the variables above to be called differently as e.g llnglps and I cant think of any other way to implement lnglp in general and then do the transformation in my translog cost function code directly. Would be very thankful for any help or any form of input / suggestions!
Best regards
Rudolf
I am currently estimating a translog cost function from a unbalanced panel data set by using a stochastic frontier model (sfpanel command).
Code: sfpanel lntc lnglp llnglps lnpe_a lnfe_a lnae_a c.lnglp#c.lnpe_a c.lnglp#c.lnfe_a c.lnglp#c.lnae_a c.llnpe_as#c.llnfe_as c.llnpe_as#c.llnae_as c.llnae_as#c.llnfe_as i.year, model(bc95) dist(tn)
Where lntc is log of total cost, lnglp (log of gross loan portfolio) is my output variable and lnpe, lnfe and lnae are my input prices in log. The other variables are specified according to the formula (see attachment formula (3)) I am using e.g llnglps = 0.5*(lnglp)^2. I get (at least from my understanding good results when I run this. However in my next step I need to calculate the marginal costs for each firm, year observation in my dataset, I tried to use the margins command to calculate the first derivative of my translog cost function with respect to lnglp (my output variable) see also formula (4) in attachment.
Code: margins, dydx(lnglp) gen(MCF)
Now I am wondering if this is correct? Meaning if the command actually takes the derivative to each term where lnglp is involved or only to lnglp itself, as I pre specified the variables above to be called differently as e.g llnglps and I cant think of any other way to implement lnglp in general and then do the transformation in my translog cost function code directly. Would be very thankful for any help or any form of input / suggestions!
Best regards
Rudolf
Comment