*! version 1.0.1 15sep2016

*! version 1.0.2 21sep2016

help prodestalso see: prodest predict

Title

prodest - Production Function Estimation

Syntax

Olley and Pakes (OP, 1996) methodology

prodest depvar [if] [in]
, free(varlist) proxy(varlist) state(varlist) method(op) [control(varlist) acf id(varname) t(varname) reps(#)
valueadded level(#) poly(#) fsresidual(newname) endogenous(varlist) translog opt_options OP_options]

Levinsohn and Petrin (LP, 2003) methodology

prodest depvar [if] [in]
, free(varlist) proxy(varlist) state(varlist) method(lp) [control(varlist) acf id(varname) t(varname) reps(#)
valueadded level(#) poly(#) fsresidual(newname) endogenous(varlist) translog opt_options LP_options]

Wooldridge (WRDG, 2009) methodology

prodest depvar [if] [in]
, free(varlist) proxy(varlist) state(varlist) method(wrdg) [control(varlist) id(varname) t(varname) reps(#)
valueadded level(#) poly(#) fsresidual(newname) endogenous(varlist) overidentification gmm opt_options WRDG_options]

Robinson/Wooldridge (ROB, 2009) methodology

prodest depvar [if] [in]
, free(varlist) proxy(varlist) state(varlist) method(rob) [control(varlist) id(varname) t(varname) reps(#)
valueadded level(#) poly(#) fsresidual(newname) endogenous(varlist) overidentification opt_options ROB_options]

Mollisi and Rovigatti (MrEst, 2017) methodology

prodest depvar [if] [in]
, free(varlist) proxy(varlist) state(varlist) method(mr) [control(varlist) id(varname) t(varname) reps(#)
valueadded level(#) poly(#) fsresidual(newname) lags(#) endogenous(varlist) overidentification opt_options Mr_options]

method(name) accepts values op (Olley-Pakes), lp (Levinshon-Petrin), wrdg (Wooldridge), rob (Robinson/Wooldridge) and mr (MrEst). Default is lp

A panel and a time variable must be specified. Use xtset or the id(varname) and t(varname) options.

OP_options

Model
* state(varlist) state variable(s). Ln(capital) in OP, 1996

* free(varlist) free variable(s). Ln(labour) in OP, 1996

* proxy(varlist) proxy variable(s). Ln(investment) in OP, 1996

control(varlist) control variable(s) to be included

endogenous(varlist) endogenous variable(s) to be included

acf apply the Ackerberg, Caves and Frazer (2015) correction

valueadded depvar is the value added of output. Default is gross output

attrition correct for attrition - i.e. firm exit - in the data

translog use a translog production function for estimation - ACF only

Optimization
optimizer(opttype) available optimizers are Nelder-Mead (nm), modified Newton-Raphson (nr),
Davidon-Fletcher-Powell (dfp), Broyden-Fletcher-Goldfarb-Shanno (bfgs), Berndt-Hall-Hall-Hausman (bhhh) and Gauss-Newton (gn)

maxiter max number of iterations, default is 10,000

Other
id(varname) panelvar to xtset the data

t(varname) timevar to xtset the data

reps(#) number of bootstrap repetitions; minimum is 2, default is 5

poly(#) degree of polynomial approximations; ranges 2 to 6, default is 3

fsresiduals(newname) save first stage residuals in var newname

Reporting
level(#) set confidence level; default is level(95).

LP_options

Model
* state(varlist) state variable(s). Ln(capital) in LP, 2003

* free(varlist) free variable(s). Ln(labour) in LP, 2003

* proxy(varlist) proxy variable(s). Ln(intermediate inputs) in LP, 2003

control(varlist) control variable(s) to be included

endogenous(varlist) endogenous variable(s) to be included

acf apply the Ackerberg, Caves and Frazer (2015) correction

valueadded depvar is the value added of output. Default is gross output

attrition correct for attrition - i.e. firm exit - in the data

translog use a translog production function for estimation - ACF only

Optimization
optimizer(opttype) available optimizers are Nelder-Mead (nm), modified Newton-Raphson (nr),
Davidon-Fletcher-Powell (dfp), Broyden-Fletcher-Goldfarb-Shanno (bfgs), Berndt-Hall-Hall-Hausman (bhhh) and Gauss-Newton (gn)

maxiter max number of iterations, default is 10,000

Other
id(varname) panelvar to xtset the data

t(varname) timevar to xtset the data

reps(#) number of bootstrap repetitions; minimum is 2, default is 5

poly(#) degree of polynomial approximations; ranges 2 to 6, default is 3

fsresiduals(newname) save first stage residuals in var newname

Reporting
level(#) set confidence level; default is level(95).

WRDG_options

Model
* state(varlist) state variable(s). Ln(capital) in WRDG, 2009

* free(varlist) free variable(s). Ln(labour) in WRDG, 2009

* proxy(varlist) proxy variable(s). Ln(intermediate inputs) in WRDG, 2009

control(varlist) control variable(s) to be included

endogenous(varlist) endogenous variable(s) to be included

valueadded depvar is the value added of output. Default is gross output

Optimization
optimizer(opttype) available optimizers are Nelder-Mead (nm), modified Newton-Raphson (nr),
Davidon-Fletcher-Powell (dfp), Broyden-Fletcher-Goldfarb-Shanno (bfgs), Berndt-Hall-Hall-Hausman (bhhh) and Gauss-Newton (gn)

maxiter max number of iterations, default is 10,000

Other
overidentification includes lagged polynomial in state and proxy among the instruments

id(varname) panelvar to xtset the data

t(varname) timevar to xtset the data

poly(#) degree of polynomial approximations; ranges 2 to 6, default is 3

gmm run the estimation with the gmm command

Reporting
level(#) set confidence level; default is level(95).

ROB_options

Model
* state(varlist) state variable(s). Ln(capital) in WRDG, 2009

* free(varlist) free variable(s). Ln(labour) in WRDG, 2009

* proxy(varlist) proxy variable(s). Ln(intermediate inputs) in WRDG, 2009

control(varlist) control variable(s) to be included

endogenous(varlist) endogenous variable(s) to be included

valueadded depvar is the value added of output. Default is gross output

Optimization
optimizer(opttype) available optimizers are Nelder-Mead (nm), modified Newton-Raphson (nr),
Davidon-Fletcher-Powell (dfp), Broyden-Fletcher-Goldfarb-Shanno (bfgs), Berndt-Hall-Hall-Hausman (bhhh) and Gauss-Newton (gn)

maxiter max number of iterations, default is 10,000

Other
overidentification includes lagged polynomial in state and proxy among the instruments

id(varname) panelvar to xtset the data

t(varname) timevar to xtset the data

poly(#) degree of polynomial approximations; ranges 2 to 6, default is 3

Reporting
level(#) set confidence level; default is level(95).

Mr_options

Model
* state(varlist) state variable(s)

* free(varlist) free variable(s)

* proxy(varlist) proxy variable(s)

control(varlist) control variable(s) to be included

endogenous(varlist) endogenous variable(s) to be included

valueadded depvar is the value added of output. Default is gross output

lags(#) lags to be used as Blundell-Bond-type instruments

Optimization
optimizer(opttype) available optimizers are Nelder-Mead (nm), modified Newton-Raphson (nr),
Davidon-Fletcher-Powell (dfp), Broyden-Fletcher-Goldfarb-Shanno (bfgs), Berndt-Hall-Hall-Hausman (bhhh) and Gauss-Newton (gn)

maxiter max number of iterations, default is 10,000

Other
overidentification includes lagged polynomial in state and proxy among the instruments

id(varname) panelvar to xtset the data

t(varname) timevar to xtset the data

poly(#) degree of polynomial approximations; ranges 2 to 6, default is 3

fsresiduals(newname) save first stage residuals in var newname

Reporting
level(#) set confidence level; default is level(95).

Optimization Options

Optimization
optimizer(opttype) available optimizers are Nelder-Mead (nm), modified Newton-Raphson (nr),
Davidon-Fletcher-Powell (dfp) and Broyden-Fletcher-Goldfarb-Shanno (bfgs), Berndt-Hall-Hall-Hausman (bhhh) and Gauss-Newton (gn)

maxiter(#) max number of iterations, default is 10,000

evaluator(string) init_evaluator_type(), default is d0 (gf0 for bhhh)

tolerance(#) init_conv_nrtol(), default is e-05

Optimizer Techniques

nm Nelder-Mead*

nr modified Newton-Raphson

dfp Davidon-Fletcher-Powell

bfgs Broyden-Fletcher-Goldfarb-Shanno

gn Gauss-Newton**

bhhh Berndt-Hall-Hall-Hausman*

*op and lp methods only
**wrdg and mr methods only

Description

prodest aims at estimating production functions using the control function approach. It includes Olley-Pakes (OP), Levinshon-Petrin (LP), Wooldridge (WRDG) and Ackerberg-Caves-Frazer (ACF) estimation methodologies. A new technique (MrEst) has been added in order to deal with short panels.
By default, the command requires the log gross output [or value added] variable (y_i,t), a set of free variables (typically log labour, w_i,t), a set of state variables (typically log capital, k_i,t) and a set of proxy variables.

Consider the following Cobb-Douglas production technology for firm i at time t:

y_i,t = alpha + w_i,t*beta + k_i,t*gamma + omega_i,t + epsilon_i,t

where y_it is the (log) gross output, w_it is a 1xJ vector of (log) free variables, k_it is a 1xK vector of state variables and epsilon_it is a normally distributed idiosyncratic error term.
The random component omega_it is the unobserved technical efficiency parameter. It evolves according to a first-order Markov process:

omega_it = E(omega_i,t | omega_i,t-1) + u_i,t = g(omega_i,t-1) + u_i,t

and u_i,t is a random shock component assumed to be uncorrelated with the technical
efficiency, the state variables in k_it and the lagged free variables (w_i,t-1).
Productivity estimation in OP and LP methods (and their ACF corrections) is performed in two steps:

i)

the OP method relies on the following set of assumptions:

a) inv_i,t = inv(k_i,t , omega_i,t) - investments are a function of both the state variable and the technical efficiency parameter;
b) inv_i,t is strictly monotone in omega_i,t ;
c) omega_i,t is scalar unobservable in i_i,t = i(.) ;
d) the levels of inv_i,t and k_i,t are decided at time t-1; the level of the free variable, w_i,t , is decided after the shock u_i,t realizes.

Assumptions a)-d) ensure the invertibility of inv_i,t in omega_i,t and lead to the partially identified model:

y_i,t = alpha + w_i,t*beta + k_i,t*gamma + h(inv_i,t, k_i,t ) + epsilon_i,t = alpha + w_i,t*beta + psi(inv_i,t , k_i,t) + epsilon_i,t

which can be estimated by non parametric approach - First Stage. Exploiting the Markovian nature of the productivity process one can exploit assumption d) as moment conditions to estimate the production function parameters - Second stage.
Exploting the resisual e_i,t of:

y_i,t - w_i,t*beta_hat = alpha + k_i,t*gamma + g(omega_i,t-1,chi_i,t) + e_i,t

where g(.) is typically left unspecified and approximated by a n-th order polynomial and chi_i,t is an inidicator function for the attrition in the market.

ii)

LP aimed to overcome the empirical issue of zeros in the investment data: They proposed instead to use intermediate inputs as a proxy
variable for omega_i,t , under the following set of assumptions:

a) firms immediately adjust the level of inputs according to demand function m(omega_i,t , k_i,t) after the technical efficiency shock is realized;
b) m_i,t is strictly monotone in omega_i,t ;
c) omega_i,t is scalar unobservable in m_i,t = m(.) ;
d) the levels of k_i,t are decided at time t-1; the level of the free variable, w_i,t , is decided after the shock u_i,t is realized.

Assumptions a)-d) ensure the invertibility of m_i,t in omega_i,t and lead to the partially identified model:

y_i,t = alpha + w_i,t*beta + psi(m_i,t , k_i,t) + v_i,t

which can be estimated by non parametric approach - First Stage. Exploiting the Markovian nature of the productivity process one can exploit assumption d) as moment conditions to estimate the production function parameters - Second stage.
Exploting the resisual v_i,t of:

y_i,t - w_i,t*beta_hat = alpha + k_i,t*gamma + g(omega_i,t-1,chi_i,t) + v_i,t

where g(.) is typically left unspecified and approximated by a n-th order polynomial and chi_i,t is an inidicator function for the attrition in the market.

iii)

Labour demand and the control function are partially collinear. ACF proposed an alternative estimation algorithm based on the following assumptions:

a) p_i,t = p(k_i,t , l_i,t , omega_i,t) is the proxy variable policy function ;
b) Strict monotonicity holds for p_i,t relative to omega_i,t ;
c) omega_i,t is scalar unobservable in p_i,t = p(.) ;
d) The state variable are decided at time t-1. The less variable labor input, l_i,t , is chosen at t-b, where 0 < b < 1.
The free variables, w_i,t, are chosen in t when the firm productivity shock is realized.

Under this set of assumptions, the first stage is meant to remove the shock epsilon_i,t from the the output, y_i,t. As before, the policy function can replace, once inverted, the productivity term, omega_i,t, in the production function, yielding:

y_i,t = k_i,t*gamma + w_i,t*beta + mu*l_i,t + h(p_i,t , k_i,t ,w_i,t , l_i,t) + epsilon_i,t

which can be estimated by non parametric approach - First Stage. Exploiting the Markovian nature of the productivity process one can exploit assumption d) as moment conditions to estimate the production function parameters - Second stage.
Exploting the resisual u_i,t of:

omega_i,t = E(omega_i,t | omega_i,t-1) + u_i,t} = g(omega_i,t-1) + u_i,t

iv)

Wooldridge proposed a more efficient approach to implement OP and LP methodology. The two stages are jointly estimated and the estimator does not suffer from the collinearity issue identified in OP/LP methodology.
Wooldridge's system gmm is based on the following assumptions:

a) omega_i,t = g(x_i,t , p_i,t), productivity is an unknown function g(.) of state and a vector of proxy variables, p_i,t ;
b) E(omega_i,t | omega_i,t-1 ,...,,omega_i,t-T) = E(omega_i,t|omega_i,t-1), t = 2,,3,...,,T. Assumption b restrains the productivity's
dynamic to a first order Markov chain process.
c) E(omega_i,t | omega_i,t-1)=f[omega_i,t-1], productivity is an unknown function f[.] of lagged productivity, omega_i,t-1.

Under the above set of assumptions, It is possible to construct a system gmm using the vector of residuals from

y_i,t - alpha - w_i,t*beta - x_i,t*gamma - g(x_i,t , p_i,t) (1)
r_i,t =
y_i,t - alpha - w_i,t*beta - x_i,t*gamma - f[g(x_i,t-1 , p_i,t-1)] (2)

where the unknown function f(.) is approximeted by a n-th polynomial and g(x_i,t , m_i,t) = lambda_0 + c(x_i,t , m_i,t)*lambda. In particular, g(x_i,t , m_i,t) is a linear combination of functions in (x_i,t , m_i,t)
where c_i,t are the addends of this linear combination. The residuals r_i,t are used to set the moment conditions

E(Z_i,t*r_i,t) =0

with the following set of instruments:

z1_i,t = (1 , w_i,t , x_i,t , c_i,t)
Z_i,t =
z2_i,t = (w_i , t-1 , x_i,t , c_i,t-1)

Moreover, Wooldridge shows how - in an ACF setting - it is possible to consistently estimate beta and gamma by an instrumental variable version of Robinson (1988), using x_i,t , x_i,t-1 and m_i,t as included instruments and w_i,t-1 as excluded instrument for w_i,t , with f(.) and g(.) left unspecified.

v)

Previous lags of free and state variables are potentially valid instruments in a Wooldridge-type estimation framework. However, adding instruments in such context would lead to a reduced sample size, and this could be problematic given the "large N, small T" nature of most dataset used in the related literature.
Introducing dynamic panel instruments à la Blundell-Bond is a solution to the issue: this allows to exploit the additional information in the lagged instruments without losing observations and estimation power. Defining the residual function matrix as:

y_i,2 - alpha - w_i,2*beta - x_i,2*gamma - g(x_i,2 , p_i,2)
y_i,2 - alpha - w_i,2*beta - x_i,1*gamma - f[g(x_i,1 , p_i,1)]
r_i,t = ...
...
y_i,t - alpha - w_i,t*beta - x_i,t*gamma - g(x_i,t , p_i,t)
y_i,t - alpha - w_i,t*beta - x_i,t*gamma - f[g(x_i,t-1 , p_i,t-1)]

for each panel i we define t - b the last available lag (i.e. b = 1 at t = 2, b = 2 at t = 3, etc.). Then, define Z_i the dynamic panel instrument matrix for each panel (we suppress the subscript i):

z'_2 z'_3 ... z'_T 0 0 0 0
0 0 ... 0 S'_3 0 0 0
Z = 0 0 ... 0 0 S'_4 0 0
0 0 ... 0 0 0 ... S'_T
0 0 ... 0 1 1 ... 1

where S_t is a 1xb vector consisting of [z_t-1, ... , z_t-b]. Usual moment conditions E[Z_i,t r_i,t] = 0 define the MrEst.

Examples

. insheet using "https://raw.githubusercontent.com/GabrieleRovigatti/prodest/master/stata/data/prodest.csv", names clear}

(load data)

. xtset id year, y /* not run */

Olley and Pakes method

. prodest log_y, free(log_lab1 log_lab2) state(log_k) proxy(log_investment) va met(op) poly(4) reps(40) id(id) t(year)

(click to run)

Ackerberg, Caves and Frazer correction
. prodest log_y, free(log_lab1 log_lab2) state(log_k) proxy(log_investment) va met(op) acf opt(nm) reps(50) id(id) t(year) fsresiduals(fs_acf_op)

(click to run)

Levinsohn and Petrin method

. prodest log_y, free(log_lab1 log_lab2) state(log_k) proxy(log_materials) va met(lp) opt(dfp) reps(50) id(id) t(year) fsresiduals(fs_lp)

(click to run)

Ackerberg, Caves and Frazer correction
. prodest log_y, free(log_lab1 log_lab2) state(log_k) proxy(log_materials) va met(lp) acf reps(50) id(id) t(year)

(click to run)

Wooldridge method

. prodest log_y, free(log_lab1 log_lab2) state(log_k) proxy(log_materials) va met(wrdg) poly(2) id(id) t(year)

(click to run)

MrEst method

. prodest log_y, free(log_lab1 log_lab2) state(log_k) proxy(log_materials) va met(mr) lags(1) poly(2) id(id) t(year)

(click to run)

References

Ackerberg D. A., Caves K., and Frazer G., 2015
Identification properties of recent production function estimators.
Econometrica, 83, (6), pp. 2411-2451.

Levinsohn, J. and Petrin, A., 2003.
Estimating Produciton Functions Using Inputs to Control for Unobservables.
Review of Economic Studies, 70, pp. 317-341.

Rovigatti, G. and Mollisi, V., 2018
Theory and practice of total-factor productivity estimation: The control function approach using Stata.
THE STATA JOURNAL, 18, (3), pp.618-662
(click to download WP - Windows)
(click to download WP - Unix)
(click to download WP - MacOSX)

Olley, S. O. and Pakes, A., 1996.
The dynamics of productivity in the telecommunications equipment industry.
Econometrica, 64, pp. 1263-1297.

Robinson, P.M., 1998.
Root-N-Consistent Semiparametric Regression.
Econometrica, 56, pp. 931-954.

Wooldridge, J., 2009.
On estimating firm-level production functions using proxy variables to control for unobservables.
Economics Letters, 104, pp. 112-114.

Saved results

prodest saves the following in e():

Scalars

e(N) number of observations

e(N_g) number of ID

e(tmin) min number of periods

e(tmean) average number of periods

e(tmax) max number of periods

Macros

e(cmd) prodest

e(depvar) name of dependent variable

e(free) varname of the free variable(s)

e(state) varname of the state variable(s)

e(proxy) varname of the proxy variable(s)

e(control) varname of the control variable(s)

e(endogenous) varname of the endogenous variable(s)

e(technique) optimization technique

e(idvar) ID variable

e(timevar) time variable

e(method) estimation methodology

e(model) value added or gross output model

e(correction) correction - ACF

e(hans_j) Hansen's J - wrdg

e(hans_p) Hansen's J p-value

Matrices

e(b) coefficient vector

e(V) variance-covariance matrix of the estimators

Functions

e(sample) marks estimation sample

Authors

Gabriele Rovigatti

Bank of Italy

Rome, Italy

gabriele.rovigatti@gmail.com

Vincenzo Mollisi

University of Rome Tor Vergata

Rome, Italy

vincenzo.mollisi@gmail.com

Also see

Online: opreg, levpet, acfest

Yasar, M., Raciborski, R. and Poi, B., 2008.
Production function estimation in Stata using the Olley and Pakes method.
The Stata Journal, 8, pp. 221-231.

Petrin, A., Poi, B. and Levinsohn, J., 2004.
Production function estimation in Stata using inputs to control for unobservables.
The Stata Journal, 4, pp. 113-123.

Manjon, M. and Manez, J., 2016.
Production function estimation in Stata using the Ackerberg-Caves-Frazer method.
The Stata Journal, 16, pp. 900-916.

Rovigatti, G., and Mollisi, V., 2018.
Theory and practice of total-factor productivity estimation: The control function approach using Stata.
The Stata Journal, 18(3), pp. 618-662.

Rovigatti, G., 2020.
Markup estimation using Stata: the Micro and the Macro approaches.
Working Paper

Bug Reporting

prodest is part of an ongoing project. Thus, it might contain errors and malfunctions. Please submit bugs, comments and suggestions via email to:

gabriele.rovigatti@gmail.com

Please try to include steps to reproduce issues and possibly the output of the Stata command -creturn list-.