The gnrprod function is the front end of the
gnrprod package. It estimates production functions and productivity
in two stages: gnrflex (estimate flexible input elasticity) and
gnriv (estimate fixed input elasticities and productivity).
If the production-related inputs are characters, a data.frame
must be specified under data. Alternatively, matrices/vectors may be
directly specified without specifying data. gnrprod currently
supports only one flexible input.
gnrprod(output, fixed, flex, share, in_price = NULL,
out_price = NULL, id, time, data, B = NULL,
fs_control = NULL, ss_control = NULL, ...)a list of class 'gnr' with five elements:
estimates: a list with two elements: elas the parameter estimates and std_errors the standard errors.
data: a data.frame containing: output, fixed, flex, share, id, time, estimated elasticities for each observation, estimated productivity, and first stage residuals.
first_stage: a list containing five elements describing the share regression (first stage):
coefficients: a numeric vector of the coefficients of the first stage estimator scaled by a constant. See Gandhi, Navarro, and Rivers (2020, p. 1994, equation (21)).
SSR: sum of squared residual.
iterations: number of iterations performed.
convergence: boolean indicating whether convergence was achieved.
control: list of convergence control parameters (see gnrflex.control).
second_stage: a list containing four elements describing the second stage:
optim_method: the method for optimization. Defaults to 'BFGS'. See optim for a listing of available methods.
optim_info: the returned list of the optim function estimating the coefficients of the constant of integration. See Gandhi, Navarro, and Rivers (2020, p. 1994, equation (21)).
optim_control: the list of control parameters passed to optim.
degree_w: degree of Markov process for persistent productivity.
degree_tau: degree of expansion for constant of integration.
call: the function call.
name (character) of variable of log gross output in data or a numeric vector.
name (character or character vector) of variables of log fixed inputs in data or a numeric matrix.
name (character) of variable of log flexible input in data or a numeric vector.
name (character) of variable of log intermediate input's revenue share in data or a numeric vector.
optional (required if share is not specified) name (character) of variable of common flexible input price or a numeric vector.
optional (required if share is not specified) name (character) of variable of common output price or a numeric vector.
name (character) of variable of firm ID in data or a numeric vector.
name (character) of variable of time in data or a numeric vector.
data.frame containing all variables with names specified by arguments above (left empty if arguments above are vector/matrix rather than strings).
number of bootstrap repetitions to retrieve standard errors of elasticity estimates. By default, gnrprod does not bootstrap, i.e., B = NULL. Setting B > 1 will output bootstrapped standard errors.
an optional list of convergence settings of the first stage. See gnrflex.control for listing.
an optional list of convergence settings of the second stage. See gnriv.control for listing.
additional optional arguments to be passed to optim in the second stage.
Gandhi, Amit, Salvador Navarro, and David Rivers. 2020. "On the Identification of Gross Output Production Functions." Journal of Political Economy, 128(8): 2973-3016. tools:::Rd_expr_doi("10.1086/707736").
require(gnrprod)
data <- colombian
industry_311 <- gnrprod(output = "RGO", fixed = c("L", "K"),
flex = "RI", share = "share", id = "id",
time = "year", data = data,
fs_control = list(degree = 2, maxit = 200),
ss_control = list(trace = 1))
Run the code above in your browser using DataLab