* * Chapter 4 exercise. System of factor demands * From pp 317-320 * open data greene.xls data(org=columns,format=xls) 1 99 id tc q pl pk pf sl sk * * id = firm ID * tc = total cost * q = output in kilowatt hours * pl = price of labor * pk = price of capital services * pf = price of fuel * sl = labor factor share * sk = capital factor share * * Define sf as residual from labor and capital * set sf = 1-sl-sk * * (a) Simple statistics * table / q sl sk sf * * (b) Random-effects estimation. * * First do multivariate regression without cross-equation restrictions. Since the * regressors are the same across equations, multivariate regression w/o * cross-equation restrictions is equivalent to equation by equation OLS. * * Estimation with capital share equation dropped * * Define parameters. * nonlin al af gll glf gfl gff gly gfy * * Define two equation system * frml labor sl = al+gll*log(pl/pk)+glf*log(pf/pk)+gly*log(q) frml fuel sf = af+gfl*log(pl/pk)+gff*log(pf/pk)+gfy*log(q) * * Set starting values for the parameters. * compute al=af=gll=glf=gfl=gff=gly=gfy=0 * * Now do multivariate regression w/o cross-eq. restriction. * nlsystem(outsigma=sigma) / labor fuel * * Now impose cross-equation restriction on fuel share equation, that is, make * gfl=glf. There are two ways to do this * * Method (1): reparameterize the equations * * Define parameters. * nonlin al af gll glf gff gly gfy * * Impose symmetry * frml fuelb sf = af+glf*log(pl/pk)+gff*log(pf/pk)+gfy*log(q) * * Multivariate regression with covariance matrix calculated from * equation-by-equation OLS residuals * nlsystem(cv=sigma) / labor fuelb * * Method (2): impose the restriction in the parameter set, and use the original * equations * nonlin al af gll glf gfl gff gly gfy glf=gfl nlsystem(cv=sigma) / labor fuel * * (c) Calculate Sargan's statistic * * Step (1). Get the residuals * set ul = sl-labor set uf = sf-fuel * * Step (2). Compute a cross product matrix including the explanatory variables * (=instruments), and the residuals. This will include all the pieces that we * need for computing the Sargan statistic * set ploverk = log(pl/pk) set pfoverk = log(pf/pk) set logq = log(q) * cmom(print) # constant ploverk pfoverk logq ul uf * * Step (3). Compute the statistic. sxy-delta*sxz is (here) just the sum of u * kroneker x, divided by n. That will just be the part of the %cmom where the u's * intersect the x's. x'x will be the top submatrix * compute sxu=%xsubmat(%cmom,1,4,5,6) compute sxx=%xsubmat(%cmom,1,4,1,4) compute sargan=%qform(%kroneker(inv(sigma),inv(sxx)),%vec(sxu)) cdf(title="Sargan Statistic") chisqr sargan 1 * * (e) Wald test of symmetry. Go back to the unconstrained estimates * nonlin al af gll glf gfl gff gly gfy nlsystem(cv=sigma,vcv) / labor fuel * * Test that the difference between coefficients 4 and 5 is 0 * restrict(title="Wald Test of Symmetry") 1 # 4 5 # 1 -1 0 * * (f) Calculate average labor-capital substitution elasticity * * Redo the restricted estimates * nonlin al af gll glf gfl gff gly gfy glf=gfl nlsystem(cv=sigma) / labor fuel * * Compute the missing parameters * compute ak =1-al-af compute glk=-(gll+glf) compute gfk=-(gfl+gff) compute gkk=-(gfk+glk) compute gky=-(gly+gfy) * * Compute the fitted cost shares for labor and capital * set slfit = al+gll*log(pl/pf)+glk*log(pk/pf)+gly*log(q) set skfit = ak+glk*log(pl/pf)+gkk*log(pk/pf)+gky*log(q) set elk = (glk+slfit*skfit)/(slfit*skfit) table / slfit skfit elk