Learn R Programming

sfa (version 1.0-1)

sfa: Fitting stochastic frontier analysis models

Description

sfa is used to fit stochastic frontier analysis models.

Usage

sfa(formula, data = NULL, intercept = TRUE, fun = "hnormal",
pars = NULL, par_mu = NULL, form = "cost", method = "BFGS", ...)

Arguments

formula
an object of class formula (or one that can be coerced to that class): a symbolic description of the model to be fitted.
data
a data frame.
intercept
logical. If true the model includes intercept.
fun
specifies the distribution for the inefficency term u as half-normal ("hnormal"), exponential ("exp"), or truncated-normal ("tnormal").
pars
initial values for the parameters to be estimated.
par_mu
value for mu in the normal-/truncated-normal case. If mu is known.
form
specifies the form of the frontier model as "cost" or "production".
method
the method to be used. See optim for more details.
...
ignored.

Value

  • sfa returns an object of class sfa:
  • yresponse
  • xcovariables
  • Xdesign matrix
  • coefcoefficients
  • sigmau2sigmau2
  • sigmav2sigmav2
  • mumu of the truncated-normal distribution (Only if fun = tnormal)
  • par_muNULL if mu is not estimated
  • logLikvalue of the log likelihood function
  • maxliklog likelihood function
  • fundistribution of the inefficiency term u
  • scspecifies the form of the frontier model (-1 = cost, 1 = production)
  • hessa symmetric matrix giving an estimate of the Hessian at the solution found (See optim)
  • olsthe linear model for the LR-test

Examples

Run this code
set.seed(225)
daten <- dgp(n = 100, b = c(1, 2), sc = -1)
test <- sfa(y ~ x, data = daten)

Run the code above in your browser using DataLab