View source: R/model_extractors.R
| as_metafrontier_model | R Documentation |
Generic function that extracts the components needed by
metafrontier from a pre-fitted frontier model.
Methods are provided for sfaR ("sfacross"),
frontier ("frontier"), and Benchmarking
("Farrell") objects, as well as plain lists with the
required fields.
as_metafrontier_model(x, ...)
x |
a fitted frontier model object. |
... |
additional arguments passed to methods. |
metafrontier(models = ...) calls this function internally on
each supplied model, so fitted sfaR or frontier objects
can be passed to metafrontier() directly. Manual conversion
is only needed for hand-built list models. Converting an object that
has already been converted is a no-op, so it is safe to pass
converted objects to metafrontier() as well.
Note that Benchmarking::dea() ("Farrell") objects do
not store the inputs, outputs, or frontier coefficients, so the
converted model carries only efficiency scores and cannot be used
with metafrontier(models = ...); use the formula interface
with method = "dea" instead. Converting a Farrell object
therefore raises a warning.
A list of class "metafrontier_model" with components:
beta, te, X, y, sigma_v,
sigma_u, logLik, hessian, n,
dist.
# Using a named list:
mod <- as_metafrontier_model(list(
coefficients = c("(Intercept)" = 2, log_x1 = 0.5, log_x2 = 0.3),
efficiency = runif(50, 0.7, 1),
X = matrix(rnorm(150), 50, 3),
y = rnorm(50, 5)
))
str(mod)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.