*! Help file for flexematrix.ado version 1.0 written by Shunjie Tu (stu@cgdev.org) 15Jul2016

Title

flexematrix -- Utility to produce the matrix of substitution elasticities

Syntax

flexematrix
varname1 varname2, cmdline(string) shares(string) [options]

where

varname1 and varname2 are the variables with which
the elasticities are to be calculated.

cmdline(string) is the entire command line of the cost function estimation command.

shares(string) are two share variables in the data that
correspond 1:1 with (varname1, varname2)

Options

actual use actual shares; if not specified, use fitted shares

verbose display the detail of estimation

useshareeqs extract coefficients from share equations instead of from the cost function

Description

flexematrix produces the matrix of substitution elasticities.

With useshareeqs specified, flexematrix produces the matrix of substitution elasticities which can include those derived
from a Kth equation added by the addest command.

Examples

. *	Setpup: use data from Christensen and Greene(1976)

. import delimited using "http://people.stern.nyu.edu/wgreene/Text/Edition7/TableF4-4.txt", delimiters(" ", collapse) varn(2) clear

. drop v11

. genl plbypf = pl/pf

. genl pkbypf = pk/pf

. genl costbypf = 1000000*cost/pf

. *	make transformation

. flexmake costbypf, outputs(q) prices(pkbypf plbypf) ln half replace

. return list

. global depvar `r(depvar)'

. global ownprices `r(ownprices)'

. global ownprices2 `r(ownprices2)'

. global crossprices `r(crossprices)'

. global ownoutputs `r(ownoutputs)'

. global ownoutputs2 `r(ownoutputs2)'

. global crossoutputs `r(crossoutputs)'

. global outputsxprices `r(outputsxprices)'

. *	Now estimate the translog system

. constraint 1 _b[ln_costbypf:c.ln_pkbypf] = _b[sk:_cons]

. constraint 2 _b[ln_costbypf:c.ln_plbypf] = _b[sl:_cons]

. constraint 3 _b[ln_costbypf:c.ln_pkbypf#c.ln_pkbypf#c.__half] = _b[sk:ln_pkbypf]

. constraint 4 _b[ln_costbypf:c.ln_plbypf#c.ln_plbypf#c.__half] = _b[sl:ln_plbypf]

. constraint 5 _b[ln_costbypf:c.ln_pkbypf#c.ln_plbypf] = _b[sl:ln_pkbypf]

. constraint 6 _b[ln_costbypf:c.ln_pkbypf#c.ln_plbypf] = _b[sk:ln_plbypf]

. constraint 7 _b[ln_costbypf:c.ln_q#c.ln_pkbypf] = _b[sk:ln_q]

. constraint 8 _b[ln_costbypf:c.ln_q#c.ln_plbypf] = _b[sl:ln_q]

. sureg ($depvar $ownprices $ownprices2 $crossprices $ownoutputs $ownoutputs2 $crossoutputs $outputsxprices ) (sk $ownprices $ownoutputs ) (sl $ownprices $ownoutputs ), constraints(1/8)

. predict ln_costbypf_hat, xb

. global cmdline sureg $depvar $ownprices $ownprices2 $crossprices $ownoutputs $ownoutputs2 $crossoutputs $outputsxprices

. *	Elasticity of TC w.r.t. capital

. quadelasticity ln_pkbypf , cmdline($)

. *	Allen partial elasticity of substitution between capital and labor

. quadelasticity ln_pkbypf ln_plbypf, cmdline($) shares(sk sl)

. *	If we instead use actual factor shares (as CnG might have done):

. quadelasticity ln_pkbypf ln_plbypf, cmdline($) shares(sk sl) actual

. *	Own elasticity of demand of capital

. quadelasticity ln_pkbypf ln_pkbypf, cmdline($) shares(sk sk)

. *	If we instead use actual factor shares (as CnG might have done):

. quadelasticity ln_pkbypf ln_pkbypf, cmdline($) shares(sk sk) actual

. *	We have estimated here in the replication.

. flexematrix pkbypf plbypf, cmdline($) shares(sk sl)

. return list

. mat list r(elasticities) , format(%9.3f) title("Elasticities")

. mat list r(p_elasticities) , format(%9.3f) title("P-values of tests that elasticities = 0")

. flexematrix pkbypf plbypf, cmdline($) shares(sk sl) actual

. return list

. mat list r(elasticities) , format(%9.3f) title("Elasticities")

. mat list r(p_elasticities) , format(%9.3f) title("P-values of tests that elasticities = 0")

(click to run)

Stored results

flexematrix stores the following in r():

Matrices

r(elasticities) matrix of the value of estimated elasticities

r(se_elasticities) matrix of the standard error of estimated elasticities

r(p_elasticities) matrix of the p-value of estimated elasticities

References

Baum, C. and T. Linz (2009) "Evaluating concavity for production and cost functions,"
Stata Journal, 9-1, pp. 161–165.

Authors

Mead Over at:
Email: MOver@CGDev.Org if you observe any
problems.