*! flexelasticity help file, version 1.4 8Dec2017 by Mead Over, CGD

Title

flexelasticity-- Utility to estimate various elasticities
implied by parameter estimates of a flexible total cost function.

Syntax

flexelasticity
wrt1 [wrt2] [if] [in], [options]

where

wrt1 [wrt2] contains one or two variables with respect to which
the elasticities are to be calculated. These variables must appear on
the right-hand-side of the previously estimated cost function.

Options

cmdline(string) is the entire command line of the cost function estimation command.
If this option is omitted, flexelasticity expects to find the command line in e(cmdline).

atspecs(string) specifications for the margins command which request the
elasticity be evaluated at specified values of covariates

shares(string) compute using shares; specific to the translog

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

chain(passthru) unwind transformation for both variables

chainlhs(passthru) unwind transformation for dependent variable

chainwrt(passthru) unwind transformation for -wrt- variable

Description

flexelasticity is a post-estimation command to be used after a flexible cost function has been
estimated using the factor variable syntax as described in documentation
for the companion utility flexmake.

Depending on the variables specified as wrt1 and optionally wrt2,
the program estimates the elasticity of total cost with respect to one output,
the elasticity of total cost with respect to one input price,
the elasticity of substitution between two inputs,
or the own-price elasticity of demand of an input.

If there is only one argument, wrt1, the program estimates the elasticity of
total cost with respect to the input price or output quantity represented by that variable.
If there are two different arguments, the program assumes they are both
transformations of input prices and
estimates the Allen partial elasticity of substitution between the two inputs.
If wrt1 and wrt2 are identical, the program assumes they are
transformations of the same input price and estimates the own-price elasticity of
demand for that input.

Discussion

The examples use the 1970 electricity generation cost data from
Christensen and Greene (1976),
which is available on Greene's web site at
http://people.stern.nyu.edu/wgreene/Text/Edition7/TableF4-4.txt.
Greene suggests that replication of the results in Christensen and Greene (1976) requires
using only the first 123 of the 158 observations. But the results we obtain below
using these 123 observations are nevertheless different from
those that Christensen and Greene published in their
1976 article.
(See Table 4, p. 666, 1970 results, op cit.)

In a personal communication, Greene uses his
LIMDEP statistical package
to attempt to replicate his 1976 results, but does not succeed in exactly
replicating the results in the 1976 paper.
Using his first 123 observations, his estimated coefficients are similar to,
but not identical to those he published in 1976.
The estimates we obtain in the examples below match the results Greene
obtained and sent me. The difference between the new results,
and the original published results is too small to
affect the substantive conclusions of that early, seminal article.

Greene has surmised that his and our failure to precisely replicate his earlier results might
be due to inaccurate transcription of his data at some point between the time he
wrote his thesis and publication of his data for his textbook.
Table 10 in the 1976 published article suggests another explanation for the imperfect match.
According to that table, the authors only used 97 + 16 + 1 = 114
observations in their estimation on 1970 data, not 123.
Since there are comb(158,114) = 2.7e+39 different subsets of 114 observations
from the total list of 158 obervations and 1.3e+13 combinations of 114
from the shorter list of 123 observations,
a comprehensive search for the 114 observations
that best reproduce the 1976 published results is impossible.
Thus, it seems that if only 114 were used, there is no way now to identify them.

Examples

The following example uses Greene's data to attempt to replicate part of the results of
Christensen and Greene (1976). To replicate this example, the user may either copy and paste
the commands into Stata's command window or simply click sequentially on the highlighted
links below.

As explained in Greene's textbook and in Christensen and Greene (1976),
assuring that an estimated cost function is consistent with cost
minimization behavior requires imposing cross-equation constraints on the system
of equations composed of the cost function and its associated factor demand equations.
One set of constraints imposes homogeneity of degree 1 in input prices.
Another set, derived from Shephard's Lemma,
imposes equality between coefficients in the cost function and
coefficients in the factor demand equations.
All of these constraints on the estimated coefficients can be imposed
explicitly using Stata's constraint command.
For a cost function with multiple inputs and outputs,
these constraints are numerous and time-consuming to construct.
To facilitate formulating the expressions for these constraints,
see the companion program flexconstraints. In this help file,
which focuses on a relatively simple example,
we simply code the required constraints.

. *	Setup: Import data and restrict sample to the first 123 observations

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

. drop v11

. keep if _n < 124

We avoid explicitly coding the
homogeneity constraints by instead simply dividing total cost
(the dependent variable) and two of the three input
prices (the prices of capital and labor) by the third (the price of fuel).
(See Greene, 2018, pp. 330, 370)

. gen plbypf = pl/pf

. lab var plbypf "= pl/pf"

. gen pkbypf = pk/pf

. lab var pkbypf "= pk/pf"

. gen costbypf = 1000000*cost/pf

. lab var costbypf "= 1000000*cost/pf"

. * Apply the natural log transformation and create macros containing factor variable expressions

. flexmake costbypf, outputs(q) shares(sk sl) prices(pkbypf plbypf) ln half replace innames(k l) globals

Generate exp_k = sk * tc
Generate exp_l = sl * tc
Generate q_k = exp_k / pkbypf
Generate q_l = exp_l / plbypf

Variables transformed by the function: ln

Characteristics of transformed cost function variables

Cost- Number of Generated Number of Number of
Function obs. <=0 Transformed Transformed Transformed
Variable or missing Variable obs. <= 0 obs. >=.
======== ========== ======== ========= ===========
1 costbypf 0 ln_costbypf 0 0
2 pkbypf 0 ln_pkbypf 1 0
3 plbypf 0 ln_plbypf 0 0
4 q 0 ln_q 0 0

. return list

<output omitted>

. describe

<output omitted>

. summarize

<output omitted>

(click to import and transform the data using -flexmake-)

We use Stata's constraint command to specify
the cross-equation constraints necessary to impose Shephard's Lemma.
With the addition of the sub-command, dir, the constraint
command lists all the constraints in memory.

. 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]

. constraint dir

(click to define the constraints)

We use Stata's implementation of the
"seemingly unrelated regressions" estimator, sureg,
in order to simutaneously estimate the cost function and two of the three
cost-share equations implied by Shephard's Lemma.
To impose the above specified eight cross-equation constraints on the parameters,
we specify the constraint numbers in sureg's constraints(numlist) option.

. *	Now estimate the translog system

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

<output omitted>

. global cmdline `e(cmdline)'

. predict ln_costbypf_hat, xb

(click to estimate the system and to compute the fitted values)

After a translog cost function has been estimated,
flexelasticity with a single argument computes the elasticity of
total cost with respect to that argument. For example, the following
command estimates the elasticity of cost with respect to output.
A value of 1.0 is interpreted as constant returns to scale,
while values less than one denote increasing returns to scale.

. *	Elasticity of TC with respect to output (scale elasticity)

. flexelasticity ln_q

Elasticity of Total Cost with respect to: ln_q

Warning: expression() does not contain predict() or xb().

Predictive margins Number of obs = 123

Expression : _b[ln_q] + 2*_b[c.ln_q#c.ln_q#c.__half]*c.ln_q#c.__half + 1*_b[c.ln_q#c.ln_pkbypf]*c.ln_pkbypf + 1*_b[c.ln_q#c.ln_plbypf]*c.ln_plbypf

+

--------

| Delta-method
| Margin Std. Err. z P>|z| [95% Con f. Interval]

+

--------

_cons | .8904355 .0085397 104.27 0.000 .8736979 .9071731

+

--------

(click to estimate the elasticity of cost with respect to output)

. *	Elasticity of TC with respect to output at various output levels

. flexelasticity ln_q , atspecs(at((p10) ln_q) at((p25) ln_q) at((p50) ln_q) at((p75) ln_q) at((p90) ln_q))

<output omitted>

. *	Stata's marginsplot command shows the decline of scale elasticity with output

. marginsplot, ytitle("Elasticity of total cost" "w.r.t. output") xtitle(Centiles of output)

(click to estimate at several output centiles)

. *	Elasticity of TC with respect to the price of capital

. flexelasticity ln_pkbypf

<output omitted>

(click to estimate the elasticity of cost with respect to the price of capital)

. * Expression for the partial derivative of total cost with respect to the price of capital

. firstpartial ln_pkbypf , chain(ln) cmdline($cmdline)

<output omitted>

. global fpk `r(margexpression)'

. margins, expression($fpk) at((p25) ln_pkbypf) at((p50) ln_pkbypf) at((p75) ln_pkbypf) at((p90) ln_pkbypf)

<output omitted>

. *	Stata's marginsplot command shows the increase of the slope of TC w.r.t. the price of capital

. marginsplot, ytitle("Elasticity of total cost" "w.r.t. the price of capital") xtitle(Centiles of pk)

<output omitted>

(click to estimate the partial derivative of cost w.r.t. pk at several centiles of pk)

. *	Allen partial elasticity of substitution between capital and labor

. flexelasticity ln_pkbypf ln_plbypf, shares(sk sl)

<output omitted>

(click to estimate the elasticity of substitution between capital and labor)

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

. flexelasticity ln_pkbypf ln_plbypf, shares(sk sl) actual

<output omitted>

(click to estimate with actual factor shares)

Our estimates of the Allen partial elasticity of substitution between capital and labor 0.571 and 0.529
are of the same sign and approximate magnitude as Christensen & Greene's published estimate of 0.639 for the same elasticity.
(Table 6, p. 667, op cit.)

. *	Own elasticity of demand of capital

. flexelasticity ln_pkbypf ln_pkbypf, shares(sk sk)

<output omitted>

(click to estimate the elasticity of demand for capital)

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

. flexelasticity ln_pkbypf ln_pkbypf, shares(sk sk) actual

<output omitted>

(click to estimate with actual factor shares)

Our estimates of the own-price elasticity of the demand for capital of -0.222 and -0.242
are quite similar to Christensen & Greene's published estimate of -0.238 for the same elasticity.
(ibid.)

Type return list to see the results that flexelasticity adds to those
stored by margins in Stata's return space.

. return list

<output omitted>

(click to display the results saved by flexelasticity)

Stored results

In addition to the results stored by margins,
flexelasticity stores the following in r():

Scalars

r(sigma) the value of the estimated elasticity

r(se_sigma) the standard error of the estimated elasticity

r(p_sigma) the p-value of the estimated elasticity

References

Christensen, L. and W. Greene (1976)
"Economies of scale in US power generation",
Journal of Political Economy, 84-4, pp. 655–676.

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

Greene, W. H. 2018.
Econometric Analysis.
8th ed. Upper Saddle River, NJ: Prentice Hall.

Authors

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