Ask Your Question

# How to estimate translog production functions?

i want to estimate a translog production function, i used ols, but want to estimate elasticity of variable, how can i do this? and how can print or see the exact mount of variables used in estimation?

edit retag close merge delete

## 1 Answer

Sort by » oldest newest most voted

Use the PRINT command to print variables. eg:

print y x1 x2


Following any estimation, the number of variables and the number of observations used in the estimation are stored in the temporary variables $\$K$,$\$N$ respectively and may be printed the same way. eg.

print $K$N


Two useful examples of working with translog cost functions are here:

http://shazam.econ.ubc.ca/student/greene/cost4.sha

http://shazam.econ.ubc.ca/student/berndt/chap9.sha

For a production function the steps are usually:

* Read data from a file
read(somedata.shd) Y X1 X2

* Set sample size to work with
sample 1 100

* Create logs of the variables
genr logY=log(Y)
genr logX1=log(X1)
genr logX2=log(X2)
genr index=time(0)

* Calculate cross product manually (or convert to matrix)
genr logX12=logX1*logX2
genr logX11=0.5*logX1**2
genr logX22=0.5*logX2**2
genr index2=index**2

* OLS estimates of the coefficients of the translog production function
ols logY logX1 logX2 logX12 logX11 logX22 index index2 / coef=beta

* Keep the number of variables
gen1 k=$k-1 * Show the coefficients previously saved print beta  To compute elasticities you may use the STAT command to get the means of all variables. It is important to note that elasticities of log transformed variables are calculated differently. * First copy the data to a matrix called Z (remember the constant) genr const=1 copy logX1 logX2 logX12 logX11 logX22 index index2 const Z * Calculating elasticities at mean stat Z / mean=zbar * Evaluate at the sample means matrix M=zbar'beta gen1 f=ncdf(M) gen1 fden=exp(-M*M/2)/sqrt(2*$pi)

* Calculate elasticities assuming variables are in levels.
sample 1 K
genr em=fden*beta*zbar/f

* Now calculate elasticities assuming log transformed variables.
genr eml=fden*beta/f

* Show the elasticities of log transformed variables
print eml


Source and further examples of various elasticity calculations with SHAZAM are here: http://econpapers.repec.org/software/shzshazam/probelas.htm

more

## Stats

Asked: 2011-08-23 02:02:39 +0000

Seen: 19,024 times

Last updated: Sep 22 '15