* Partially Linear Translog Cost Function * * Keywords: * regression, ols, semiparametric, log-linear, electricity supply, cost * * Description: * We illustrate how to estimate a log-linear Electricity Supply Cost model * using standard (OLS) and semiparametric estimation techniques * * Author(s): * Noel Roy * Skif Pankov * * Source: * William H. Greene, Econometric Analysis - 7th Edition * Pearson International Edition, Chapter 7, Example 7.11 (page 251) * SAMPLE 1 158 * Reading the datafile and retrieving variables' names read (TableF4-4.shd) / names * Generating variables genr c=log(cost/q/pf) genr k=log(pk/pf) genr l=log(pl/pf) genr q=log(q) genr q2=q**2/2 * Sorting the data in output order sort q c k l q2 pf cost sample 6 140 * Estimating the parametric model, OLS log-log model ols c k l q q2 / loglog * Calculating the partial differences of the variables c, k, and l for m=2 genr cd=.809*c-.5*lag(c)-.309*lag(c,2) genr kd=.809*k-.5*lag(k)-.309*lag(k,2) genr ld=.809*l-.5*lag(l)-.309*lag(l,2) * Estimating beta1 and beta2 for the partial linear model ols cd kd ld /noconstant coef=b * Calculating the residuals to the model, and extracting log(pf) from the * residuals genr fq=c-b(1)*k-b(2)*l genr fq=fq+log(pf) * Smoothing the effect of output on average cost using kernel extimation nonpar fq q /predict=fqhat * Graphing the relationship using the original (non-log) transformation genr efq=exp(fq) genr efqhat=exp(fqhat) genr output=exp(q) graph efq efqhat output stop