Learn R Programming

micEcon (version 0.5-6)

front41WriteInput: Write input files for Frontier 4.1

Description

Write an instruction file, a data file, and a start-up file for Tim Coelli's program Frontier 4.1 that performs stochastic frontier analysis.

Usage

front41WriteInput( data, crossSectionName, timePeriodName = NULL,
   yName, xNames = NULL, qxNames = NULL, zNames = NULL, quadHalf = TRUE,
   functionType = 1, logDepVar = TRUE, mu = FALSE, eta = FALSE,
   insFile = "front41.ins", dtaFile = sub( "\.ins$", ".dta", insFile ),
   outFile = sub( "\.ins$", ".out", insFile ), startUpFile = "front41.000",
   iprint = 5, indic = 1, tol = 0.00001, tol2 = 0.001, bignum = 1.0E+16,
   step1 = 0.00001, igrid2 = 1, gridno = 0.1, maxit = 100, ite = 1 )

Arguments

data
data frame that contains the data.
crossSectionName
string: name of the cross section identifier.
timePeriodName
string: name of the time period identifier or NULL in case of cross-section data.
yName
string: name of the endogenous variable.
xNames
a vector of strings containing the names of the X variables (exogenous variables of the production or cost function).
qxNames
a vector of strings containing the names of the variables to construct quadratic and interaction terms. As a shortcut, this argument can be set to "all" for using all variables specified in argument xNames
zNames
a vector of strings containing the names of the Z variables (variables explaining the efficiency level). If it is null, an 'Error Components Frontier' is estimated; otherwise a 'Technical Efficiency Effects Frontier' is estimated.
quadHalf
logical. Multiply the quadratic terms by one half?
functionType
function type: either 1 for 'production function' or 2 for 'cost function'.
logDepVar
logical. Is the dependent variable logged.
mu
logical. Should a 'mu' (in case of an 'Error Components Frontier') or a delta0 (in case of a 'Technical Efficiency Effects Frontier') be included in the estimation.
eta
logical. Should an 'eta' be included in the estimation (only in case of an 'Error Components Frontier').
insFile
name of the instruction file.
dtaFile
name of the data file.
outFile
name of the output file.
startUpFile
name of the start-up file. If this argument is NULL, no start-up file is written.
iprint
numeric. Print info every iprint iterations; if this argument is 0, do not print.
indic
numeric. Use in unidimensional search procedure: indic = 2 says do not scale step length in unidimensional search; indic = 1 says scale (to length of last step) only if last step was smaller; indic = any other number says scale (to lengt
tol
numeric. Convergence tolerance (proportiona).
tol2
tolerance used in uni-dimensional search procedure.
bignum
numeric. Used to set bounds on den & dist.
step1
numeric. Size of 1st step in search procedure.
igrid2
numeric. 1 = double accuracy, 0 = single accuracy.
gridno
numeric. Steps taken in single accuracy grid search on gamma.
maxit
numeric. Maximum number of iterations permitted
ite
numeric. 1 = print all efficiency estimates; 0 = print only the mean efficiency.

Value

  • front41WriteInput writes an instruction file, a data file, and a start-up file for Frontier 4.1 to disk and it invisibly returns a list of class front41WriteInput. This list contains mainly the arguments with which front41WriteInput was called. An exception is element data, which is not the argument data but the data matrix that was written into the data file. Furthermore, in case of an Efficiency Effects Model, the element eta contains the number of Z variables. Additionally, the returned list contains following elements:
  • modelTypemodel type: 1 = Error Components Frontier (no Z variables), 2 = Efficiency Effects Model (with Z variables).
  • nCrossSectionnumber of cross section units.
  • nTimePeriodsnumber of time periods.
  • nTotalObstotal number of observations.
  • nXtotaltotal number of X variables (including quadratic and interaction terms).
  • nZvarsnumber of Z variables.

Details

A modified version of Tim Coelli's FRONTIER 4.1 that can be used non-interactively is available on http://www.uni-kiel.de/agrarpol/ahenningsen/frontier/. It can be called from within R using the system command (see example). This version is is available as (FORTRAN) source code and (executable) binaries for GNU/Linux and MS-Windows.

References

Battese, G.E. and T. Coelli (1992), Frontier production functions, technical efficiency and panel data: with application to paddy farmers in India. Journal of Productivity Analysis, 3, 153-169.

Battese, G.E. and T. Coelli (1995), A model for technical inefficiency effects in a stochastic frontier production function for panel data. Empirical Economics, 20, 325-332.

Coelli, T. (1996) A Guide to FRONTIER Version 4.1: A Computer Program for Stochastic Frontier Production and Cost Function Estimation, CEPA Working Paper 96/08, http://www.uq.edu.au/economics/cepa/frontier.htm, University of New England.

See Also

front41ReadOutput, front41Est

Examples

Run this code
data( Coelli )
   Coelli$logOutput  <- log( Coelli$output )
   Coelli$logCapital <- log( Coelli$capital )
   Coelli$logLabour  <- log( Coelli$labour )

   front41WriteInput( Coelli, "firm", "time", "logOutput",
      c( "logCapital", "logLabour" ), insFile = "coelli.ins" )

   system( "front41.bin coelli.ins" )
   sfa <- front41ReadOutput( "coelli.out" )

Run the code above in your browser using DataLab