* Stochastic Frontier Model * Reference: William H. Greene, Econometric Analysis, Fourth Edition, * Prentice-Hall, 2000. * Section 9.7.1, pp. 394-397. SAMPLE 1 25 FORMAT (A8,A4,1X,F10.0,F12.0,F11.0,F13.0) READ (industry.shd) STATE1-STATE2 Q K L NF / SKIPLINE=1 FORMAT GENR LQ=LOG(Q) GENR LK=LOG(K) GENR LL=LOG(L) * Least Squares OLS LQ LK LL / COEF=BOLS GEN1 SIG=SQRT($SIG2) * Set starting values for the non-linear estimation DIM BETA 5 GEN1 BETA:2=BOLS:3 GEN1 BETA:3=BOLS:1 GEN1 BETA:4=BOLS:2 GEN1 BETA:1=SIG GEN1 BETA:5=1 GENR CONSTANT=0.5*LOG(2/$PI) * Define the regression function in a character string ERROR: (LQ-(B0+BK*LK+BL*LL)) * Specify the density function for the "half-normal" model. * Use the LOGDEN option on the NL command. NL 1 / NCOEF=5 LOGDEN START=BETA COEF=BNEW EQ CONSTANT - 0.5*LOG(SIGMA**2) - 0.5*([ERROR]/SIGMA)**2 & + LOG(NCDF(-[ERROR]*LAMBDA/SIGMA)) END * Recover an estimate for sigma_v (reported as TEST VALUE). TEST (SIGMA*SIGMA/(1+LAMBDA*LAMBDA))**0.5 * Recover an estimate for sigma_u TEST (SIGMA*SIGMA*LAMBDA*LAMBDA/(1+LAMBDA*LAMBDA))**0.5 * Calculate the estimated inefficiencies GEN1 SIGMA=BNEW:1 GEN1 LAMBDA=BNEW:5 GENR Z=(LQ-(BNEW:2+BNEW:3*LK+BNEW:4*LL))*LAMBDA/SIGMA ?DISTRIB Z / PDF=PDFZ GENR U=SIGMA*LAMBDA/(1+LAMBDA*LAMBDA)*(PDFZ/(1-NCDF(Z))-Z) FORMAT(1X,A8,A4,F12.4) PRINT STATE1-STATE2 U / FORMAT STOP