| Title: | Visualization of Data Envelopment Analysis Problems |
|---|---|
| Description: | High-dimensional visualization methods for data envelopment analysis (DEA), gathering in one place techniques that have appeared in the literature but remained scattered and largely unimplemented: cross-efficiency matrix unfolding, the Porembski network with lambda edges, principal component analysis biplots, multidimensional-scaling colour-plots, self-organizing maps, the Costa bi-dimensional efficient frontier, parallel coordinates, radar charts, panel-data trajectory biplots, peer and reference networks, and a set of descriptive plots. The package is built around a single validated dea_data() object and uses the 'Benchmarking' package as its DEA engine. The implemented methods draw on a body of literature; representative references include Doyle and Green (1994) <doi:10.1057/jors.1994.84>, Porembski, Breitenstein and Alpar (2005) <doi:10.1007/s11123-005-1328-5> and Bana e Costa, Soares de Mello and Angulo Meza (2016) <doi:10.1016/j.ejor.2016.05.012>. |
| Authors: | Shahin Ashkiani [aut, cre] |
| Maintainer: | Shahin Ashkiani <[email protected]> |
| License: | AGPL (>= 3) |
| Version: | 0.1.0 |
| Built: | 2026-07-03 07:51:16 UTC |
| Source: | https://github.com/pomelo64/deaviz |
Coerce to a dea_data object
as_dea_data(x, ...)as_dea_data(x, ...)
x |
A |
... |
Passed to |
A dea_data object.
df <- data.frame(city = c("A", "B"), i_x = c(4, 7), o_y = c(5, 8)) d <- as_dea_data(df) # coerces a data frame to dea_data as_dea_data(d) # already a dea_data: returned unchangeddf <- data.frame(city = c("A", "B"), i_x = c(4, 7), o_y = c(5, 8)) d <- as_dea_data(df) # coerces a data frame to dea_data as_dea_data(d) # already a dea_data: returned unchanged
A benchmark data envelopment analysis (DEA) dataset describing 35 major Chinese cities by three inputs and three outputs. Originally introduced by Sueyoshi (1992), it is the example dataset used to illustrate the DEA-Viz methods in Ashkiani (2019) and has appeared in several DEA studies.
chinese_citieschinese_cities
A data frame with 35 rows and 7 variables:
City name (the decision-making unit label).
Input 1: industrial labour force.
Input 2: working funds.
Input 3: investment.
Output 1: gross industrial output.
Output 2: profit and tax.
Output 3: retail sales.
Columns 2–4 are inputs and columns 5–7 are outputs; column 1 holds
the DMU labels. Because the columns are not i_/o_ prefixed,
pass them explicitly to dea_data (see Examples).
Sueyoshi, T. (1992). Measuring the industrial performance of Chinese cities by data envelopment analysis. Socio-Economic Planning Sciences, 26(2), 75-88. doi:10.1016/0038-0121(92)90015-W
Reproduced as the worked example in Ashkiani, S. (2019), Four Essays on Data Visualization and Anomaly Detection of Data Envelopment Analysis Problems (PhD thesis), Universitat Autonoma de Barcelona.
d <- dea_data( chinese_cities, inputs = c("industrial_labour_force", "working_funds", "investments"), outputs = c("gross_industrial_output", "profit_and_tax", "retail_sales"), id = "DMU" ) dd <- dea_data( chinese_cities, inputs = c("industrial_labour_force", "working_funds", "investments"), outputs = c("gross_industrial_output", "profit_and_tax", "retail_sales"), id = "DMU" ) d
Computes data envelopment analysis (DEA) efficiency scores for a set of
decision-making units, under any of the returns-to-scale assumptions
supported by dea. The numerical work is done by
the Benchmarking package; this function wraps it so the input/output
data follow the dea_data contract and the call sits inside one
consistent entry point.
compute_efficiency( x, rts = c("crs", "vrs", "drs", "irs", "irs2", "fdh", "add"), orientation = "in", dual = TRUE, slack = FALSE, ... )compute_efficiency( x, rts = c("crs", "vrs", "drs", "irs", "irs2", "fdh", "add"), orientation = "in", dual = TRUE, slack = FALSE, ... )
x |
A |
rts |
Returns to scale, one of |
orientation |
Measurement orientation, forwarded to
|
dual |
Logical; if |
slack |
Logical; if |
... |
Further arguments forwarded to |
The returns-to-scale assumption is selected with rts: in particular
"crs" (constant) and "vrs" (variable) are the two most common
models, but "drs", "irs", "irs2", "fdh" and
"add" are available as well.
The Farrell object returned by
dea, whose $eff component holds the
efficiency scores.
dea, which performs the computation;
dea_data for the data contract.
df <- data.frame(i_x = c(2, 3, 4), o_y = c(1, 2, 2)) compute_efficiency(df, rts = "crs")$eff compute_efficiency(df, rts = "vrs")$effdf <- data.frame(i_x = c(2, 3, 4), o_y = c(1, 2, 2)) compute_efficiency(df, rts = "crs")$eff compute_efficiency(df, rts = "vrs")$eff
Solves the input-oriented, constant-returns-to-scale (CCR) multiplier
DEA model for every decision-making unit and returns the optimal efficiency
scores together with the input and output weights. A non-Archimedean lower
bound epsilon keeps all weights strictly positive.
compute_multiplier_weights(x, epsilon = 1e-06)compute_multiplier_weights(x, epsilon = 1e-06)
x |
A |
epsilon |
Non-Archimedean lower bound on every multiplier weight; must
be a single non-negative number. Defaults to |
For unit the model maximises the weighted output
subject to the normalisation and
for every unit , with
. The optimal value is the unit's efficiency score.
DEA multiplier solutions are generally not unique: efficient units and degenerate vertices admit alternative optimal weight vectors. This function returns one optimal solution (the vertex the solver settles on), not a canonical one. Treat the returned weights accordingly when they feed downstream calculations such as cross-efficiency.
A list with components
effnamed numeric vector of efficiency scores.
input_weightsmatrix of input multipliers (one row per DMU, one column per input).
output_weightsmatrix of output multipliers (one row per DMU, one column per output).
All rows are labelled with the DMU labels carried by x.
compute_efficiency for scores via
dea; dea_data for the data
contract.
df <- data.frame(i_x = c(2, 3, 4), o_y = c(1, 2, 2)) w <- compute_multiplier_weights(df) w$eff w$input_weightsdf <- data.frame(i_x = c(2, 3, 4), o_y = c(1, 2, 2)) w <- compute_multiplier_weights(df) w$eff w$input_weights
Trains a hexagonal self-organizing map (SOM) on the standardised input/output
data and records, for every node, the mean DEA efficiency of the DMUs mapped
to it. The result feeds plot_io_som (and other SOM views), so the
map is trained once and reused.
compute_som( x, rts = c("crs", "vrs"), xdim = 8, ydim = 8, rlen = 1000, seed = NULL, ... )compute_som( x, rts = c("crs", "vrs"), xdim = 8, ydim = 8, rlen = 1000, seed = NULL, ... )
x |
A |
rts |
Returns to scale, passed to |
xdim, ydim
|
Grid dimensions (positive integers; default |
rlen |
Number of training iterations (default |
seed |
Optional single number; if supplied, SOM training is made reproducible without permanently changing the session's random state. |
... |
Further arguments passed to |
An object of class dea_som: a list with the fitted
som (a kohonen object), the DMU labels, per-DMU
efficiency, per-node mean node_efficiency (NA for empty
nodes), and the grid dimensions.
df <- data.frame( dmu = paste0("D", 1:12), i_x1 = runif(12, 2, 9), i_x2 = runif(12, 1, 5), o_y1 = runif(12, 3, 9), o_y2 = runif(12, 1, 4) ) som <- compute_som(df, xdim = 4, ydim = 4, seed = 1) somdf <- data.frame( dmu = paste0("D", 1:12), i_x1 = runif(12, 2, 9), i_x2 = runif(12, 1, 5), o_y1 = runif(12, 3, 9), o_y2 = runif(12, 1, 4) ) som <- compute_som(df, xdim = 4, ydim = 4, seed = 1) som
Functions for the cross-efficiency analysis of a DEA problem: the
cross-efficiency matrix itself (compute_cross_efficiency), the
benevolent multiplier weights used to build it
(compute_cross_efficiency_weights), and a helper to put those weights on a
common scale (standardize_weights).
compute_cross_efficiency( x, approach = c("benevolent", "aggressive"), epsilon = 0 ) compute_cross_efficiency_weights( x, approach = c("benevolent", "aggressive"), epsilon = 0, normalize = TRUE ) standardize_weights(weights)compute_cross_efficiency( x, approach = c("benevolent", "aggressive"), epsilon = 0 ) compute_cross_efficiency_weights( x, approach = c("benevolent", "aggressive"), epsilon = 0, normalize = TRUE ) standardize_weights(weights)
x |
A |
approach |
Secondary goal: |
epsilon |
Lower bound applied to every multiplier weight. The default
|
normalize |
Logical; if |
weights |
A list with |
compute_cross_efficiency returns an numeric
matrix whose entry [k, j] is the efficiency of DMU j evaluated
with the weights of DMU k (rows are rating units, columns are rated
units). Row and column names are the DMU labels.
compute_cross_efficiency_weights returns a list with matrices
input_weights and output_weights (one row per DMU, labelled).
standardize_weights returns a list of the same shape as
weights, row-standardised and rounded to 5 digits.
compute_cross_efficiency(): Compute the cross-efficiency matrix.
compute_cross_efficiency_weights(): Secondary-goal multiplier weights for every DMU.
standardize_weights(): Row-standardise a set of weights so that, within
each DMU, the input weights sum to one and the output weights sum to one.
Multiplier (weight) solutions in DEA are not unique, so cross-efficiency
requires a secondary goal to choose among a unit's optimal weights. For unit
the model fixes the unit's own efficiency at its CRS score
and then, among all weight vectors that keep it there,
optimises the total weighted output of the other units –
maximising it for the "benevolent" approach, minimising it for the
"aggressive" one. The unit's own efficiencies and the
fall-back weights come from a single dea solve.
Doyle, J., & Green, R. (1994). Efficiency and cross-efficiency in DEA: Derivations, meanings and uses. Journal of the Operational Research Society, 45(5), 567–578. doi:10.1057/jors.1994.84
Doyle, J., & Green, R. (1994). Efficiency and cross-efficiency in DEA: Derivations, meanings and uses. Journal of the Operational Research Society, 45(5), 567–578. doi:10.1057/jors.1994.84
Doyle, J., & Green, R. (1994). Efficiency and cross-efficiency in DEA: Derivations, meanings and uses. Journal of the Operational Research Society, 45(5), 567–578. doi:10.1057/jors.1994.84
df <- data.frame( dmu = c("A", "B", "C", "D"), i_x1 = c(4, 7, 8, 4), i_x2 = c(3, 3, 1, 2), o_y = c(1, 1, 1, 1) ) ce <- compute_cross_efficiency(df, approach = "benevolent") round(ce, 3) colMeans(ce) # each unit's average cross-efficiencydf <- data.frame( dmu = c("A", "B", "C", "D"), i_x1 = c(4, 7, 8, 4), i_x2 = c(3, 3, 1, 2), o_y = c(1, 1, 1, 1) ) ce <- compute_cross_efficiency(df, approach = "benevolent") round(ce, 3) colMeans(ce) # each unit's average cross-efficiency
Builds a validated dea_data object from a data frame, classifying
columns into inputs and outputs. By default columns are recognised by an
i_ prefix (inputs) and an o_ prefix (outputs); the prefixes are
stripped from the stored names for display. Columns can also be selected
explicitly via inputs/outputs, which overrides the prefixes.
Any remaining column is treated as metadata; a non-numeric one (or an
explicit id) supplies the DMU labels.
dea_data(data, inputs = NULL, outputs = NULL, id = NULL)dea_data(data, inputs = NULL, outputs = NULL, id = NULL)
data |
A data frame (or object coercible to one) with named columns: at least one input column and one output column. |
inputs, outputs
|
Optional column selectors (character names or integer
positions). When supplied they take precedence over the |
id |
Optional single column (name or position) holding DMU labels. If
|
An object of class dea_data: a list with components
Xnumeric matrix of inputs (one row per DMU).
Ynumeric matrix of outputs (one row per DMU).
labelscharacter vector of DMU labels.
compute_efficiency, as_dea_data
df <- data.frame( city = c("A", "B", "C"), i_lab = c(10, 12, 9), i_cap = c(5, 6, 4), o_gdp = c(100, 130, 90) ) dea_data(df) # explicit selection, no prefixes needed: df2 <- setNames(df, c("city", "lab", "cap", "gdp")) dea_data(df2, inputs = c("lab", "cap"), outputs = "gdp", id = "city") # numeric DMU id codes must be named explicitly: df3 <- data.frame(dmu = 1001:1003, i_x = c(2, 3, 4), o_y = c(1, 2, 2)) dea_data(df3, id = "dmu")df <- data.frame( city = c("A", "B", "C"), i_lab = c(10, 12, 9), i_cap = c(5, 6, 4), o_gdp = c(100, 130, 90) ) dea_data(df) # explicit selection, no prefixes needed: df2 <- setNames(df, c("city", "lab", "cap", "gdp")) dea_data(df2, inputs = c("lab", "cap"), outputs = "gdp", id = "city") # numeric DMU id codes must be named explicitly: df3 <- data.frame(dmu = 1001:1003, i_x = c(2, 3, 4), o_y = c(1, 2, 2)) dea_data(df3, id = "dmu")
Draws the cross-efficiency matrix (CEM) as a heatmap: each cell is the efficiency of the rated DMU (x-axis) evaluated with the weights of the rating DMU (y-axis). The diagonal holds the simple (self) efficiencies.
plot_cem_heatmap( x, labels = "all", max.overlaps.value = 10, transparency = 1, fade = TRUE, x_angle = NULL, subtitle = NULL, title = NULL, interactive = FALSE, ... )plot_cem_heatmap( x, labels = "all", max.overlaps.value = 10, transparency = 1, fade = TRUE, x_angle = NULL, subtitle = NULL, title = NULL, interactive = FALSE, ... )
x |
A cross-efficiency matrix from
|
labels |
DMU tick labels: |
max.overlaps.value |
Accepted for API consistency; unused here
(default |
transparency |
Opacity of the markers/areas, a single number in
|
fade |
Controls the single-DMU focus view. When one DMU is given to
|
x_angle |
Angle in degrees for the x-axis tick labels, useful when
the input/output (or DMU) names on the x-axis are long and overlap.
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. |
interactive |
Logical; static ggplot2 (default) or interactive plotly. |
... |
When |
A ggplot2 object, or a plotly object when
interactive = TRUE.
Doyle, J., & Green, R. (1994). Efficiency and cross-efficiency in DEA: Derivations, meanings and uses. Journal of the Operational Research Society, 45(5), 567–578. doi:10.1057/jors.1994.84
compute_cross_efficiency, plot_cem_unfolding
df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_cem_heatmap(compute_cross_efficiency(df))df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_cem_heatmap(compute_cross_efficiency(df))
Applies multidimensional unfolding (Ashkiani and Mar-Molinero, 2017) to a
cross-efficiency matrix, placing each DMU twice – once as a "rating" unit
(the weights it applies) and once as a "rated" unit – so that a rating unit
sits close to the units it scores highly. Dissimilarities are taken as
1 - CEM.
plot_cem_unfolding( x, labels = "none", max.overlaps.value = 10, transparency = 0.7, fade = TRUE, subtitle = NULL, title = NULL, interactive = FALSE, ... )plot_cem_unfolding( x, labels = "none", max.overlaps.value = 10, transparency = 0.7, fade = TRUE, subtitle = NULL, title = NULL, interactive = FALSE, ... )
x |
A cross-efficiency matrix from
|
labels |
Which DMUs to label: |
max.overlaps.value |
Passed to ggrepel when
|
transparency |
Opacity of the markers/areas, a single number in
|
fade |
Controls the single-DMU focus view. When one DMU is given to
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. |
interactive |
Logical; static ggplot2 (default) or interactive plotly. |
... |
When |
A ggplot2 object, or a plotly object when
interactive = TRUE.
Ashkiani, S., & Mar-Molinero, C. (2017). Visualization of cross-efficiency matrices using multidimensional unfolding. In Recent Applications of Data Envelopment Analysis.
compute_cross_efficiency,
unfolding
df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) ce <- compute_cross_efficiency(df) plot_cem_unfolding(ce)df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) ce <- compute_cross_efficiency(df) plot_cem_unfolding(ce)
Draws a heatmap of each DMU's secondary-goal (benevolent or aggressive) multiplier weights, one row per DMU and one column per input/output. By default the weights are row-standardised (input weights sum to one, output weights sum to one within each DMU) so the relative emphasis is comparable across units.
plot_cem_weights_heatmap( x, approach = c("benevolent", "aggressive"), standardize = TRUE, labels = "all", max.overlaps.value = 10, transparency = 1, fade = TRUE, x_angle = NULL, subtitle = NULL, title = NULL, interactive = FALSE, ... )plot_cem_weights_heatmap( x, approach = c("benevolent", "aggressive"), standardize = TRUE, labels = "all", max.overlaps.value = 10, transparency = 1, fade = TRUE, x_angle = NULL, subtitle = NULL, title = NULL, interactive = FALSE, ... )
x |
A weights list from |
approach |
Secondary goal used when the weights are computed from data:
|
standardize |
Logical; if |
labels |
DMU tick labels: |
max.overlaps.value |
Accepted for API consistency; unused here
(default |
transparency |
Opacity of the markers/areas, a single number in
|
fade |
Controls the single-DMU focus view. When one DMU is given to
|
x_angle |
Angle in degrees for the x-axis tick labels, useful when
the input/output (or DMU) names on the x-axis are long and overlap.
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. |
interactive |
Logical; static ggplot2 (default) or interactive plotly. |
... |
When |
A ggplot2 object, or a plotly object when
interactive = TRUE.
Doyle, J., & Green, R. (1994). Efficiency and cross-efficiency in DEA: Derivations, meanings and uses. Journal of the Operational Research Society, 45(5), 567–578. doi:10.1057/jors.1994.84
compute_cross_efficiency_weights,
standardize_weights
df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_cem_weights_heatmap(df, approach = "benevolent")df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_cem_weights_heatmap(df, approach = "benevolent")
Summarises the DEA efficiency scores of the decision-making units as a histogram (default), a boxplot, or a per-DMU bar chart. More than one returns-to-scale model can be requested at once: histograms are then stacked vertically (one panel per model) and boxplots are drawn side by side, each model in its own colour.
plot_efficiency_distributions( x, rts = "crs", orientation = "in", type = c("histogram", "box", "bar"), bins = 30, labels = "none", max.overlaps.value = 10, transparency = 0.7, subtitle = NULL, title = NULL, interactive = FALSE, ... )plot_efficiency_distributions( x, rts = "crs", orientation = "in", type = c("histogram", "box", "bar"), bins = 30, labels = "none", max.overlaps.value = 10, transparency = 0.7, subtitle = NULL, title = NULL, interactive = FALSE, ... )
x |
A |
rts |
Returns-to-scale model(s) passed to
|
orientation |
Measurement orientation passed to
|
type |
|
bins |
Number of histogram bins (used when |
labels |
Which DMUs to mark: |
max.overlaps.value |
Accepted for API consistency; unused here
(default |
transparency |
Opacity of the markers/areas, a single number in
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. |
interactive |
Logical; static ggplot2 (default) or interactive plotly. |
... |
Additional arguments passed to the underlying geom. |
A ggplot2 object, or a plotly object when
interactive = TRUE.
compute_efficiency, plot_io_efficients
df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_efficiency_distributions(df, rts = "crs") plot_efficiency_distributions(df, rts = c("crs", "vrs"), type = "box")df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_efficiency_distributions(df, rts = "crs") plot_efficiency_distributions(df, rts = c("crs", "vrs"), type = "box")
Plots the DMUs in three dimensions, with each axis and the point colour set
to any input/output variable or any DEA efficiency model (so a returns-to-
scale efficiency such as "crs" or "vrs" can be used as a
dimension). Efficiencies are computed only when referenced, each at most
once. This plot is always interactive (plotly); it has no static form.
plot_io_3dscatter( x, dim_x, dim_y, dim_z, color = "crs", orientation = "in", labels = "none", max.overlaps.value = 10, transparency = 0.7, subtitle = NULL, title = NULL, ... )plot_io_3dscatter( x, dim_x, dim_y, dim_z, color = "crs", orientation = "in", labels = "none", max.overlaps.value = 10, transparency = 0.7, subtitle = NULL, title = NULL, ... )
x |
A |
dim_x, dim_y, dim_z
|
Names of the quantities to map to the three axes.
Each is either an input/output variable name or an efficiency model
( |
color |
Quantity mapping to point colour (same options as the axes;
default |
orientation |
Measurement orientation for efficiency scores, passed to
|
labels |
Which DMUs to label: |
max.overlaps.value |
Accepted for API consistency; unused here
(default |
transparency |
Opacity of the markers/areas, a single number in
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. |
... |
Additional arguments passed to |
A plotly object.
df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_3dscatter(df, dim_x = "x1", dim_y = "x2", dim_z = "y", color = "crs")df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_3dscatter(df, dim_x = "x1", dim_y = "x2", dim_z = "y", color = "crs")
Draws the Costa et al. (2016) two-dimensional representation of a DEA
problem. Each DMU's multiplier weights are standardised and used to collapse
its inputs and outputs into a single weighted input I and weighted
output O; efficient units fall on the O = I diagonal (the
frontier) and inefficient units below it. Uses the constant-returns-to-scale
model; weights come from compute_efficiency.
plot_io_costa_frontier( x, orientation = c("in", "out"), point_size = 2, transparency = 0.7, fade = TRUE, labels = "none", max.overlaps.value = 10, subtitle = NULL, title = NULL, interactive = FALSE, ... )plot_io_costa_frontier( x, orientation = c("in", "out"), point_size = 2, transparency = 0.7, fade = TRUE, labels = "none", max.overlaps.value = 10, subtitle = NULL, title = NULL, interactive = FALSE, ... )
x |
A |
orientation |
Measurement orientation, |
point_size |
Point size (default |
transparency |
Point alpha in |
fade |
Controls the single-DMU focus view. When one DMU is given to
|
labels |
Which DMUs to label: |
max.overlaps.value |
Passed to ggrepel when
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. |
interactive |
Logical; static ggplot2 (default) or interactive plotly. |
... |
Additional arguments passed to |
A ggplot2 object, or a plotly object when
interactive = TRUE.
Bana e Costa, C. A., Soares de Mello, J. C. C. B., & Angulo Meza, L. (2016). A new approach to the bi-dimensional representation of the DEA efficient frontier with multiple inputs and outputs. European Journal of Operational Research, 255(1), 175–186. doi:10.1016/j.ejor.2016.05.012
df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_costa_frontier(df, orientation = "in")df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_costa_frontier(df, orientation = "in")
Shows the distribution of every input and output, either as faceted histograms (default) or as boxplots. By default the variables are standardised so they share a common scale.
plot_io_distributions( x, type = c("histogram", "box"), bins = 30, scale = TRUE, labels = "none", max.overlaps.value = 10, transparency = 0.7, x_angle = NULL, subtitle = NULL, title = NULL, interactive = FALSE, ... )plot_io_distributions( x, type = c("histogram", "box"), bins = 30, scale = TRUE, labels = "none", max.overlaps.value = 10, transparency = 0.7, x_angle = NULL, subtitle = NULL, title = NULL, interactive = FALSE, ... )
x |
A |
type |
|
bins |
Number of histogram bins (used when |
scale |
Logical; if |
labels |
Which DMUs to mark: |
max.overlaps.value |
Accepted for API consistency with the other
plots; unused here (default |
transparency |
Opacity of the markers/areas, a single number in
|
x_angle |
Angle in degrees for the x-axis tick labels, useful when
the input/output (or DMU) names on the x-axis are long and overlap.
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. |
interactive |
Logical; if |
... |
Additional arguments passed to the underlying geom
( |
A ggplot2 object, or a plotly object when
interactive = TRUE.
df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_distributions(df) plot_io_distributions(df, type = "box")df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_distributions(df) plot_io_distributions(df, type = "box")
Classifies the DMUs as efficient or inefficient (efficiency score equal to 1 within a tolerance) and draws a bar chart of the counts, annotated with the percentage of DMUs in each group.
plot_io_efficients( x, rts = c("crs", "vrs", "drs", "irs", "fdh", "add"), orientation = "in", tol = 1e-06, labels = TRUE, transparency = 0.7, subtitle = NULL, title = NULL, interactive = FALSE, ... )plot_io_efficients( x, rts = c("crs", "vrs", "drs", "irs", "fdh", "add"), orientation = "in", tol = 1e-06, labels = TRUE, transparency = 0.7, subtitle = NULL, title = NULL, interactive = FALSE, ... )
x |
A |
rts |
Returns to scale passed to |
orientation |
Measurement orientation passed to
|
tol |
Tolerance for treating a score as efficient (default
|
labels |
Logical; if |
transparency |
Opacity of the markers/areas, a single number in
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. |
interactive |
Logical; static ggplot2 (default) or interactive plotly. |
... |
Additional arguments passed to |
A ggplot2 object, or a plotly object when
interactive = TRUE.
plot_efficiency_distributions, compute_efficiency
df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_efficients(df, rts = "crs")df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_efficients(df, rts = "crs")
Draws a DMU-by-variable heatmap of the input and output values, with DMUs on
the y-axis and variables on the x-axis (inputs labelled I_, outputs
O_). By default the values are standardised column-wise so they are
comparable across variables.
plot_io_heatmap( x, scale = TRUE, labels = "all", max.overlaps.value = 10, transparency = 1, fade = TRUE, x_angle = NULL, subtitle = NULL, title = NULL, interactive = FALSE, ... )plot_io_heatmap( x, scale = TRUE, labels = "all", max.overlaps.value = 10, transparency = 1, fade = TRUE, x_angle = NULL, subtitle = NULL, title = NULL, interactive = FALSE, ... )
x |
A |
scale |
Logical; if |
labels |
DMU tick labels: |
max.overlaps.value |
Accepted for API consistency; unused here
(default |
transparency |
Opacity of the markers/areas, a single number in
|
fade |
Controls the single-DMU focus view. When one DMU is given to
|
x_angle |
Angle in degrees for the x-axis tick labels, useful when
the input/output (or DMU) names on the x-axis are long and overlap.
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. |
interactive |
Logical; static ggplot2 (default) or interactive plotly. |
... |
Additional arguments passed to |
A ggplot2 object, or a plotly object when
interactive = TRUE.
df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_heatmap(df)df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_heatmap(df)
Projects the DMUs into two dimensions with Sammon mapping and draws the DEA
reference network on top: each DMU is a node coloured by efficiency status,
and an edge joins unit to a reference peer whenever the
envelopment weight exceeds edge_threshold. Edge
width is proportional to , shown in the legend.
plot_io_lambda_network( x, rts = c("crs", "vrs"), edge_threshold = 0.1, labels = "none", max.overlaps.value = 10, transparency = 0.7, fade = TRUE, subtitle = NULL, title = NULL, interactive = FALSE, ... )plot_io_lambda_network( x, rts = c("crs", "vrs"), edge_threshold = 0.1, labels = "none", max.overlaps.value = 10, transparency = 0.7, fade = TRUE, subtitle = NULL, title = NULL, interactive = FALSE, ... )
x |
A |
rts |
Returns to scale, passed to |
edge_threshold |
Minimum envelopment weight for an edge to be drawn
(single non-negative number, default |
labels |
Which DMUs to label: |
max.overlaps.value |
Passed to ggrepel when
|
transparency |
Node alpha in |
fade |
Controls the single-DMU focus view. When one DMU is given to
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. |
interactive |
Logical; static ggplot2 (default) or interactive plotly. |
... |
Further arguments passed to |
A ggplot2 object, or a plotly object when
interactive = TRUE.
Porembski, M., Breitenstein, K., & Alpar, P. (2005). Visualizing efficiency and reference relations in data envelopment analysis with an application to the branches of a German bank. Journal of Productivity Analysis, 23(2), 203–221. doi:10.1007/s11123-005-1328-5
Sammon, J. W. (1969). A nonlinear mapping for data structure analysis. IEEE Transactions on Computers, C-18(5), 401–409. doi:10.1109/T-C.1969.222678
compute_efficiency, plot_io_peer_network,
sammon
df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_lambda_network(df, rts = "crs")df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_lambda_network(df, rts = "crs")
Places the DMUs in two dimensions by multidimensional scaling (Adler and Raveh, 2008) and colours them by a chosen quantity: a DEA efficiency score, or one of the input/output variables (or their output-to-input ratios).
plot_io_mds( x, transform = c("none", "ratio"), dist_method = c("euclidean", "manhattan", "maximum", "canberra", "minkowski"), mds_type = c("ratio", "interval", "ordinal", "mspline"), encode = "crs", point_size = 2, transparency = 0.7, fade = TRUE, labels = "none", max.overlaps.value = 10, subtitle = NULL, title = NULL, interactive = FALSE, ... )plot_io_mds( x, transform = c("none", "ratio"), dist_method = c("euclidean", "manhattan", "maximum", "canberra", "minkowski"), mds_type = c("ratio", "interval", "ordinal", "mspline"), encode = "crs", point_size = 2, transparency = 0.7, fade = TRUE, labels = "none", max.overlaps.value = 10, subtitle = NULL, title = NULL, interactive = FALSE, ... )
x |
A |
transform |
What to compute distances on: |
dist_method |
Distance measure, passed to |
mds_type |
Scaling level, passed to |
encode |
What to colour by: an efficiency model
( |
point_size |
Point size (default |
transparency |
Point alpha in |
fade |
Controls the single-DMU focus view. When one DMU is given to
|
labels |
Which DMUs to label: |
max.overlaps.value |
Passed to ggrepel when
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. If |
interactive |
Logical; static ggplot2 (default) or interactive plotly. |
... |
Additional arguments passed to |
A ggplot2 object, or a plotly object when
interactive = TRUE.
Adler, N., & Raveh, A. (2008). Presenting DEA graphically. Omega, 36(5), 715–729.
de Leeuw, J., & Mair, P. (2009). Multidimensional scaling using majorization: SMACOF in R. Journal of Statistical Software, 31(3), 1–30. doi:10.18637/jss.v031.i03
df <- data.frame( dmu = paste0("D", 1:8), i_x1 = c(4, 7, 8, 4, 2, 5, 6, 3), i_x2 = c(3, 3, 1, 2, 4, 2, 5, 1), o_y = c(5, 8, 6, 7, 3, 9, 4, 6) ) plot_io_mds(df, encode = "crs")df <- data.frame( dmu = paste0("D", 1:8), i_x1 = c(4, 7, 8, 4, 2, 5, 6, 3), i_x2 = c(3, 3, 1, 2, 4, 2, 5, 1), o_y = c(5, 8, 6, 7, 3, 9, 4, 6) ) plot_io_mds(df, encode = "crs")
Draws a parallel-coordinates plot with one axis per input and output, each
axis min-max scaled to [0, 1] so they are comparable. Each DMU is one
line; lines are coloured by efficient/inefficient status.
plot_io_parcoo( x, efficiency = c("crs", "vrs", "none"), orientation = "in", labels = "none", max.overlaps.value = 10, transparency = 0.7, fade = TRUE, x_angle = NULL, subtitle = NULL, title = NULL, interactive = FALSE, ... )plot_io_parcoo( x, efficiency = c("crs", "vrs", "none"), orientation = "in", labels = "none", max.overlaps.value = 10, transparency = 0.7, fade = TRUE, x_angle = NULL, subtitle = NULL, title = NULL, interactive = FALSE, ... )
x |
A |
efficiency |
Efficiency model used to colour the lines by
efficient/inefficient status: |
orientation |
Measurement orientation for the efficiency scores,
passed to |
labels |
Which DMUs to label at the right-hand axis: |
max.overlaps.value |
Passed to ggrepel when
|
transparency |
Opacity of the markers/areas, a single number in
|
fade |
Controls the single-DMU focus view. When one DMU is given to
|
x_angle |
Angle in degrees for the x-axis tick labels, useful when
the input/output (or DMU) names on the x-axis are long and overlap.
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. |
interactive |
Logical; static ggplot2 (default) or interactive plotly. |
... |
Additional arguments passed to |
A ggplot2 object, or a plotly object when
interactive = TRUE.
compute_efficiency, plot_io_radar
df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_parcoo(df, efficiency = "crs")df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_parcoo(df, efficiency = "crs")
Runs a principal component analysis on the standardised input/output data and
draws a biplot: DMUs as points coloured by efficiency status, and the
variables as labelled vectors. Efficiency comes from
compute_efficiency.
plot_io_pca_biplot( x, rts = c("crs", "vrs"), vector_size = 1, text_size = 3, labels = "none", max.overlaps.value = 10, transparency = 0.7, fade = TRUE, subtitle = NULL, title = NULL, interactive = FALSE, seed = NA, ... )plot_io_pca_biplot( x, rts = c("crs", "vrs"), vector_size = 1, text_size = 3, labels = "none", max.overlaps.value = 10, transparency = 0.7, fade = TRUE, subtitle = NULL, title = NULL, interactive = FALSE, seed = NA, ... )
x |
A |
rts |
Returns to scale, passed to |
vector_size |
Positive multiplier scaling the length of the variable
vectors relative to the point cloud (default |
text_size |
Size of the variable labels (default |
labels |
Which DMUs to label: |
max.overlaps.value |
Passed to ggrepel when
|
transparency |
Point alpha in |
fade |
Controls the single-DMU focus view. When one DMU is given to
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. |
interactive |
Logical; static ggplot2 (default) or interactive plotly. |
seed |
Optional seed for |
... |
Additional arguments passed to |
A ggplot2 object, or a plotly object when
interactive = TRUE.
df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y1 = c(5, 8, 6, 7, 3, 9), o_y2 = c(2, 3, 1, 2, 1, 4) ) plot_io_pca_biplot(df, rts = "crs")df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y1 = c(5, 8, 6, 7, 3, 9), o_y2 = c(2, 3, 1, 2, 1, 4) ) plot_io_pca_biplot(df, rts = "crs")
Draws a directed network of DMUs: each inefficient unit has arrows pointing to its efficient peers (the targets in its DEA reference set, i.e. the efficient units with a positive envelopment weight). Arrowheads stop short of the target node so the direction stays readable. Nodes are coloured by efficiency status and, optionally, efficient nodes are sized by how often they are a target.
plot_io_peer_network( x, rts = c("crs", "vrs"), layout = c("pca", "mds", "circle", "fr", "stress"), size_by_peers = FALSE, tol = 1e-06, labels = "none", max.overlaps.value = 10, transparency = 0.7, fade = TRUE, subtitle = NULL, title = NULL, interactive = FALSE, ... )plot_io_peer_network( x, rts = c("crs", "vrs"), layout = c("pca", "mds", "circle", "fr", "stress"), size_by_peers = FALSE, tol = 1e-06, labels = "none", max.overlaps.value = 10, transparency = 0.7, fade = TRUE, subtitle = NULL, title = NULL, interactive = FALSE, ... )
x |
A |
rts |
Returns to scale, passed to |
layout |
Node layout: |
size_by_peers |
Logical; if |
tol |
Tolerance for a positive envelopment weight (default |
labels |
Which DMUs to label: |
max.overlaps.value |
Passed to ggrepel when
|
transparency |
Node alpha in |
fade |
Controls the single-DMU focus view. When one DMU is given to
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. |
interactive |
Logical; static ggplot2 (default) or interactive plotly. |
... |
Additional arguments passed to |
A ggplot2 object, or a plotly object when
interactive = TRUE.
compute_efficiency, plot_io_lambda_network
df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_peer_network(df, rts = "crs", size_by_peers = TRUE)df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_peer_network(df, rts = "crs", size_by_peers = TRUE)
Draws a radar (spider) plot with one axis per input and output, each min-max
scaled to [0, 1], and one closed polygon per DMU with straight edges.
Polygons are coloured by efficient/inefficient status. A radial counterpart to
plot_io_parcoo.
plot_io_radar( x, efficiency = c("crs", "vrs", "none"), orientation = "in", labels = "none", max.overlaps.value = 10, transparency = 0.7, fade = TRUE, subtitle = NULL, title = NULL, interactive = FALSE, ... )plot_io_radar( x, efficiency = c("crs", "vrs", "none"), orientation = "in", labels = "none", max.overlaps.value = 10, transparency = 0.7, fade = TRUE, subtitle = NULL, title = NULL, interactive = FALSE, ... )
x |
A |
efficiency |
Efficiency model used to colour the DMUs by
efficient/inefficient status: |
orientation |
Measurement orientation for the efficiency scores. |
labels |
DMU emphasis: |
max.overlaps.value |
Accepted for API consistency; unused here
(default |
transparency |
Opacity of the markers/areas, a single number in
|
fade |
Controls the single-DMU focus view. When one DMU is given to
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. |
interactive |
Logical; if |
... |
Additional arguments passed to |
A ggplot2 object, or a plotly object when
interactive = TRUE.
plot_io_parcoo, compute_efficiency
df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_radar(df, efficiency = "crs")df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_radar(df, efficiency = "crs")
Builds the pairwise scatter plots of a chosen set of columns: any subset of
the inputs and outputs, plus optionally one or more efficiency scores. For
k selected columns it draws all choose(k, 2) pairwise panels.
For example, selecting one input, one output and the CRS score gives three
panels.
plot_io_scatter( x, vars = NULL, efficiency = NULL, color = c("crs", "vrs", "drs", "irs", "fdh", "add", "none"), correlation = TRUE, orientation = "in", labels = "none", max.overlaps.value = 10, transparency = 0.7, fade = TRUE, subtitle = NULL, title = NULL, interactive = FALSE, ... )plot_io_scatter( x, vars = NULL, efficiency = NULL, color = c("crs", "vrs", "drs", "irs", "fdh", "add", "none"), correlation = TRUE, orientation = "in", labels = "none", max.overlaps.value = 10, transparency = 0.7, fade = TRUE, subtitle = NULL, title = NULL, interactive = FALSE, ... )
x |
A |
vars |
Character vector of input/output column names to include. Defaults to all inputs and outputs. |
efficiency |
Optional character vector of efficiency models to compute
and include as columns, any of |
color |
Efficiency model used to colour points by efficient/inefficient
status: one of |
correlation |
Logical; if |
orientation |
Measurement orientation used when computing efficiency scores. |
labels |
Which DMUs to label: |
max.overlaps.value |
Accepted for API consistency; unused here
(default |
transparency |
Point alpha in |
fade |
Controls the single-DMU focus view. When one DMU is given to
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. |
interactive |
Logical; static ggplot2 (default) or interactive plotly. |
... |
Additional arguments passed to |
A ggplot2 object, or a plotly object when
interactive = TRUE.
df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_scatter(df, vars = c("x1", "y"), efficiency = "crs")df <- data.frame( dmu = paste0("D", 1:6), i_x1 = c(4, 7, 8, 4, 2, 5), i_x2 = c(3, 3, 1, 2, 4, 2), o_y = c(5, 8, 6, 7, 3, 9) ) plot_io_scatter(df, vars = c("x1", "y"), efficiency = "crs")
Draws the hexagonal SOM as a property map, colouring each node by the mean efficiency of the DMUs assigned to it, and (optionally) labels the nodes with the DMU names. Uses base graphics, so the plot is produced as a side effect on the active device.
plot_io_som( som, labels = "all", max.overlaps.value = 10, jitter_sd = 0.1, seed = NULL, transparency = 0.7, subtitle = NULL, title = "SOM: mean efficiency per node", ... )plot_io_som( som, labels = "all", max.overlaps.value = 10, jitter_sd = 0.1, seed = NULL, transparency = 0.7, subtitle = NULL, title = "SOM: mean efficiency per node", ... )
som |
A |
labels |
Which DMUs to write on the map: |
max.overlaps.value |
Accepted for API consistency; unused here
(default |
jitter_sd |
Standard deviation of the random jitter applied to label
positions so co-located labels do not overlap (default |
seed |
Optional single number making the label jitter reproducible without changing the session's random state. |
transparency |
Opacity of the markers/areas, a single number in
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Plot title. |
... |
When |
The dea_som object, invisibly.
df <- data.frame( dmu = paste0("D", 1:12), i_x1 = runif(12, 2, 9), i_x2 = runif(12, 1, 5), o_y1 = runif(12, 3, 9), o_y2 = runif(12, 1, 4) ) som <- compute_som(df, xdim = 4, ydim = 4, seed = 1) plot_io_som(som)df <- data.frame( dmu = paste0("D", 1:12), i_x1 = runif(12, 2, 9), i_x2 = runif(12, 1, 5), o_y1 = runif(12, 3, 9), o_y2 = runif(12, 1, 4) ) som <- compute_som(df, xdim = 4, ydim = 4, seed = 1) plot_io_som(som)
Draws one SOM property map per input/output variable – the "component planes" – each node coloured by that variable's codebook weight. This shows how each input and output varies across the trained map. Uses base graphics, so the panels are produced as a side effect on the active device.
plot_io_som_components( som, variables = NULL, ncol = 3, labels = TRUE, transparency = 0.7, subtitle = NULL, title = NULL, ... )plot_io_som_components( som, variables = NULL, ncol = 3, labels = TRUE, transparency = 0.7, subtitle = NULL, title = NULL, ... )
som |
A |
variables |
Optional character vector selecting which variables to draw (default: all). Names are matched against the input/output column names. |
ncol |
Number of panels per row (positive integer; default |
labels |
Logical; if |
transparency |
Opacity of the markers/areas, a single number in
|
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional overall title drawn above the panel grid. |
... |
When |
The dea_som object, invisibly.
df <- data.frame( dmu = paste0("D", 1:12), i_x1 = runif(12, 2, 9), i_x2 = runif(12, 1, 5), o_y1 = runif(12, 3, 9), o_y2 = runif(12, 1, 4) ) som <- compute_som(df, xdim = 4, ydim = 4, seed = 1) plot_io_som_components(som)df <- data.frame( dmu = paste0("D", 1:12), i_x1 = runif(12, 2, 9), i_x2 = runif(12, 1, 5), o_y1 = runif(12, 3, 9), o_y2 = runif(12, 1, 4) ) som <- compute_som(df, xdim = 4, ydim = 4, seed = 1) plot_io_som_components(som)
For panel (long-format) DEA data, computes a single principal-component embedding of the pooled, standardised inputs and outputs (so the axes and loading vectors are fixed), then draws each DMU's path through time as a connected trajectory. Points are coloured by a DEA efficiency score and the arrow on each trajectory points from the earliest to the latest period.
plot_panel_io_biplot( panel_data, inputs = NULL, outputs = NULL, id = "Label", period = "Period", color = c("crs", "vrs"), orientation = "in", vector_size = 1, transparency = 0.7, fade = TRUE, labels = "none", max.overlaps.value = 10, period_labels = FALSE, size_by_efficiency = FALSE, subtitle = NULL, title = NULL, interactive = FALSE, ... )plot_panel_io_biplot( panel_data, inputs = NULL, outputs = NULL, id = "Label", period = "Period", color = c("crs", "vrs"), orientation = "in", vector_size = 1, transparency = 0.7, fade = TRUE, labels = "none", max.overlaps.value = 10, period_labels = FALSE, size_by_efficiency = FALSE, subtitle = NULL, title = NULL, interactive = FALSE, ... )
panel_data |
A long-format data frame with one row per DMU-period,
containing an identifier column and a period column (see |
inputs, outputs
|
Optional input/output column selectors, given either as
character names or as integer column positions (e.g. |
id, period
|
The identifier and period columns, given as a name or an
integer position (default |
color |
Efficiency model for point colour, computed per period:
|
orientation |
Measurement orientation for the efficiency scores. |
vector_size |
Positive multiplier scaling the loading vectors. |
transparency |
Point opacity. Either a single number in |
fade |
Controls the single-DMU focus view. When one DMU is given to
|
labels |
Which DMU trajectories to label at their latest period. One of
|
max.overlaps.value |
Passed to ggrepel when
|
period_labels |
Logical; if |
size_by_efficiency |
Logical; if |
subtitle |
Optional subtitle shown beneath the title. |
title |
Optional plot title. |
interactive |
Logical; static ggplot2 (default) or interactive plotly. |
... |
Additional arguments passed to |
A ggplot2 object, or a plotly object when
interactive = TRUE.
plot_io_pca_biplot, compute_efficiency
# Real multi-period example: 22 Taiwanese banks over 2009-2011. # Columns can be given by position (inputs are columns 3-5, outputs 6-8) ... plot_panel_io_biplot( taiwanese_banks, id = "DMU", period = "Year", inputs = 3:5, outputs = 6:8, labels = "Cathay" ) # ... or by name, with the loading vectors and a single bank's trajectory. plot_panel_io_biplot( taiwanese_banks, id = "DMU", period = "Year", inputs = c("labour", "physical_capital", "purchased_funds"), outputs = c("demand_deposits", "short_term_loans", "long_term_loans"), transparency = "efficiency", labels = "all" ) # A toy long-format frame using the i_/o_ prefix convention also works. panel <- data.frame( Label = rep(paste0("D", 1:4), each = 3), Period = rep(2019:2021, times = 4), i_x1 = c(4,5,5, 7,6,6, 8,8,7, 4,3,4), i_x2 = c(3,3,2, 3,4,3, 1,2,2, 2,2,1), o_y = c(5,6,7, 8,8,9, 6,6,7, 7,8,8) ) plot_panel_io_biplot(panel, labels = "D2") # highlight a single DMU# Real multi-period example: 22 Taiwanese banks over 2009-2011. # Columns can be given by position (inputs are columns 3-5, outputs 6-8) ... plot_panel_io_biplot( taiwanese_banks, id = "DMU", period = "Year", inputs = 3:5, outputs = 6:8, labels = "Cathay" ) # ... or by name, with the loading vectors and a single bank's trajectory. plot_panel_io_biplot( taiwanese_banks, id = "DMU", period = "Year", inputs = c("labour", "physical_capital", "purchased_funds"), outputs = c("demand_deposits", "short_term_loans", "long_term_loans"), transparency = "efficiency", labels = "all" ) # A toy long-format frame using the i_/o_ prefix convention also works. panel <- data.frame( Label = rep(paste0("D", 1:4), each = 3), Period = rep(2019:2021, times = 4), i_x1 = c(4,5,5, 7,6,6, 8,8,7, 4,3,4), i_x2 = c(3,3,2, 3,4,3, 1,2,2, 2,2,1), o_y = c(5,6,7, 8,8,9, 6,6,7, 7,8,8) ) plot_panel_io_biplot(panel, labels = "D2") # highlight a single DMU
Print a DEA data object
## S3 method for class 'dea_data' print(x, ...)## S3 method for class 'dea_data' print(x, ...)
x |
A |
... |
Ignored. |
x, invisibly.
Print a fitted DEA self-organizing map
## S3 method for class 'dea_som' print(x, ...)## S3 method for class 'dea_som' print(x, ...)
x |
A |
... |
Ignored. |
x, invisibly.
A balanced panel (long-format) data envelopment analysis (DEA) dataset
describing 22 Taiwanese commercial banks over three years (2009-2011) by
three inputs and three outputs. It is the worked example of Kao and Liu
(2014) on multi-period efficiency measurement, and is the example dataset for
plot_panel_io_biplot.
taiwanese_bankstaiwanese_banks
A data frame with 66 rows (22 banks 3 years) and 8
variables:
Bank name (the decision-making unit label).
Period: 2009, 2010 or 2011.
Input 1 (I1): labour.
Input 2 (I2): physical capital.
Input 3 (I3): purchased funds.
Output 1 (O1): demand deposits.
Output 2 (O2): short-term loans.
Output 3 (O3): medium- and long-term loans.
Columns 3-5 are inputs (I1-I3) and columns 6-8 are outputs (O1-O3);
DMU and Year identify each observation. The input/output
columns are not i_/o_ prefixed, so pass them by position
(e.g. inputs = 3:5, outputs = 6:8) or by name to
plot_panel_io_biplot (see Examples).
Kao, C. and Liu, S.-T. (2014). Multi-period efficiency measurement in data envelopment analysis: The case of Taiwanese commercial banks. Omega, 47, 90-98. doi:10.1016/j.omega.2013.09.001
plot_panel_io_biplot( taiwanese_banks, id = "DMU", period = "Year", inputs = 3:5, outputs = 6:8, labels = "Cathay" )plot_panel_io_biplot( taiwanese_banks, id = "DMU", period = "Year", inputs = 3:5, outputs = 6:8, labels = "Cathay" )