| Title: | Spatial Stochastic Frontier with Fixed Effects and Endogeneity |
|---|---|
| Description: | Maximum-likelihood estimation of the spatial autoregressive stochastic frontier model with individual fixed effects (removed by first differencing) and endogenous regressors handled through a Gaussian control function, as in Giannini (2025) <doi:10.1080/17421772.2024.2414962>. Returns coefficient estimates and standard errors, spatially-corrected technical (in)efficiency scores, and direct, indirect and total marginal impacts. Depends only on base R. |
| Authors: | Massimo Giannini [aut, cre] (University of Rome Tor Vergata, Department of Enterprise Engineering) |
| Maintainer: | Massimo Giannini <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-05-29 08:10:46 UTC |
| Source: | https://github.com/cran/spefa |
Conditional-mean (JLMS) inefficiency estimates with optional
spatial rescaling by .
efficiency(object, spatial = TRUE)efficiency(object, spatial = TRUE)
object |
a fitted |
spatial |
logical; apply the spatial multiplier. |
A list with the inefficiency matrix u (N x T), efficiency
eff = exp(-u), and per-unit Eu_i.
data(spefademo) fit <- spefa(y ~ x1 + q1, data = spefademo, index = c("id", "time"), W = spefaW, endogenous = list(q1 = ~ z1, q2 = ~ z2), scaling = ~ x2 + q2) ef <- efficiency(fit) summary(as.vector(ef$eff))data(spefademo) fit <- spefa(y ~ x1 + q1, data = spefademo, index = c("id", "time"), W = spefaW, endogenous = list(q1 = ~ z1, q2 = ~ z2), scaling = ~ x2 + q2) ef <- efficiency(fit) summary(as.vector(ef$eff))
LeSage-Pace decomposition of frontier marginal effects through the
spatial multiplier . Standard errors, z-statistics and
p-values are obtained by simulation from the asymptotic distribution of
.
impacts(object, ...) ## S3 method for class 'spefa' impacts(object, R = 1000, seed = NULL, ...)impacts(object, ...) ## S3 method for class 'spefa' impacts(object, R = 1000, seed = NULL, ...)
object |
a fitted |
R |
number of simulation draws for the standard errors. |
seed |
optional integer seed for reproducibility. |
... |
unused. |
An object of class impacts.spefa: a list with matrices
Direct, Indirect and Total, each with columns Estimate,
Std.Error, z value and Pr(>|z|).
data(spefademo) fit <- spefa(y ~ x1 + q1, data = spefademo, index = c("id", "time"), W = spefaW, endogenous = list(q1 = ~ z1, q2 = ~ z2), scaling = ~ x2 + q2) impacts(fit, R = 500, seed = 1)data(spefademo) fit <- spefa(y ~ x1 + q1, data = spefademo, index = c("id", "time"), W = spefaW, endogenous = list(q1 = ~ z1, q2 = ~ z2), scaling = ~ x2 + q2) impacts(fit, R = 500, seed = 1)
Maximum-likelihood estimation of a spatial autoregressive stochastic frontier model with individual fixed effects (removed by first differencing) and endogenous regressors handled by a Gaussian control function.
spefa(formula, data, index, W, endogenous = NULL, scaling = NULL, mu = FALSE, control = list(maxit = 500, reltol = 1e-9))spefa(formula, data, index, W, endogenous = NULL, scaling = NULL, mu = FALSE, control = list(maxit = 500, reltol = 1e-9))
formula |
frontier equation, e.g. |
data |
a balanced panel |
index |
length-2 character vector |
W |
an N x N spatial weight matrix, rows/cols ordered by sorted unit id. |
endogenous |
named list mapping endogenous regressors to instruments,
e.g. |
scaling |
one-sided formula of variables entering the inefficiency
scaling |
mu |
logical; if |
control |
list passed to |
An object of class spefa with methods summary,
coef, vcov, logLik, efficiency and
impacts.
data(spefademo) fit <- spefa(y ~ x1 + q1, data = spefademo, index = c("id", "time"), W = spefaW, endogenous = list(q1 = ~ z1, q2 = ~ z2), scaling = ~ x2 + q2) summary(fit)data(spefademo) fit <- spefa(y ~ x1 + q1, data = spefademo, index = c("id", "time"), W = spefaW, endogenous = list(q1 = ~ z1, q2 = ~ z2), scaling = ~ x2 + q2) summary(fit)
A small simulated balanced panel and its spatial weight matrix, used in the
examples and vignette. Generated from the model in Giannini (2025) with
, , ,
, , ,
and ; q1 and q2 are
endogenous, q1 enters the frontier and q2 the scaling.
data(spefademo)data(spefademo)
spefademo: a data.frame with 480 rows (N = 40 units, T = 12 periods)
and columns id, time, y, x1, x2, q1,
q2, z1, z2.
spefaW: a 40 x 40 row-normalised spatial weight matrix, ordered by
id.
data(spefademo) str(spefademo) dim(spefaW)data(spefademo) str(spefademo) dim(spefaW)