Description Usage Arguments Value Examples
Estimates a Stochastic Frontier Model for Fixed-Effects. sfmfep is used to fit fixed-effect stochastic frontier models for panel data using a specified model transformation. Bootstrapping can be performed to calculate the standard errors instead of a numerical deriviation via the hessian matrix.
1 2 3 4 |
formula |
an object of class "formula" in the form of y ~ x1 + ... + x_k + (z1 + ... + z_r) |
data |
an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. |
panel |
an optional vector specifying the panels to be used in the fitting process. |
N |
an optional integer specifying the total amount of panels in the data set. If N is entered, Time is also a required input. |
Time |
an optional integer specifying the amount of observations per panel. If Time is entered, N is also a required input. |
method |
a required string specifying the method ("within" or "firstdiff"). |
mu |
is the mean of a truncated normal distribution of the stochastic inefficiency. |
alphaCI |
is an optional vector specifying the significance values of the confidence intervals for the MLE estimates. |
estimate |
TRUE or FALSE specifies if "myPar" is used as starting point of the estimation, or if "myPar" is used to fit a given stochastic frontier model. |
bootstrap |
is an optional boolean variable. If it is set to TRUE, bootstrapping is performed. "B" must be specified. |
B |
is an integer which is a required input for Bootstrap = T. It defines the amount of bootstrap samples. |
parallel |
is an optional boolean variable. If it is set to TRUE, bootstrapping is performed with parallelization, using all available cores - 1. Only available for OS Windows. |
myPar |
is a vecor which has to be entered in the following order: c(sigma_v, sigma_u, beta = c( ), delta = c( )) |
sfmfep returns an object of class S3 "sfmfep". The function summary( ) can be used to obtain or print a summary of the results.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | # Fit of a simple model with balanced panels.
# Definition with *N & T*.
# Data has 10 observations for each of the 20 panels.
fit1 <- sfmfep(formula = y ~ x + (z),
method = "within", N = 40, Time = 5, data = sfm.data)
summary(fit1)
# ---------------
# Fit of a simple model with balanced panels.
# Definition with *panels*.
fit2 <- sfmfep(formula = y ~ x + (z),
method = "within", panel = sfm.data$producer, data = sfm.data)
summary(fit2)
# ---------------
# Fit of a simple model with *Bootstrapping* using
# *method = firstdiff*
# with different *sigmas* for *Confidence Intervals*
fit3 <- sfmfep(formula = y ~ x + (z),
bootstrap = TRUE, B = 20, alphaCI = c(0.1, 0.05),
method = "firstdiff", panel = sfm.data$producer, data = sfm.data)
summary(fit3)
# ---------------
# Fitting a model *without estimating*, providing model parameters.
fit4 <- sfmfep(formula = y ~ x + (z),
myPar = c(sigma_u = 0.2, sigma_v = 0.1, beta = 0.5, delta = 0.5),
estimate = FALSE,
method = "firstdiff", panel = sfm.data$producer, data = sfm.data)
summary(fit4)
# ---------------
# Perform Bootstrapping with starting points for the optimizier
fit5 <- sfmfep(formula = y ~ x + (z),
myPar = c(sigma_u = 0.2, sigma_v = 0.1, beta = 0.5, delta = 0.5),
estimate = TRUE, bootstrap = TRUE, B = 20,
method = "firstdiff", panel = sfm.data$producer, data = sfm.data)
summary(fit5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.