DEA分析技术求助:rDEA包中输出变量未生效问题排查
Hey there! Let's figure out why your DEA analysis isn't responding to adding the L (loans to public) and II (interest income) output variables. This is a common issue, and we can break down the debugging steps below:
Key Checks & Fixes
1. Test for Multicollinearity Between Output Variables
The most likely culprit is perfect or near-perfect multicollinearity among your output variables. If L and D (deposits?) are highly correlated, or II is a linear function of NII (non-interest income), the DEA model will treat the extra variables as redundant—so adding them won't change the efficiency scores.
To verify this, calculate the correlation matrix for your output variables:
cor(out_var)
Look for correlation coefficients close to 1 or -1. If, for example, II is almost exactly proportional to L, the model doesn't gain any new information by including II, hence no change in results.
2. Validate Data Quality & Variable Types
Double-check that your variables are correctly formatted and free of issues that might make them irrelevant to the model:
- Use
str(PANELDATA)to confirm all input/output variables are numeric (not factors or character strings). - Run
summary(out_var)to check for extreme values, zeroes, or missing data. IfLorIIhave zero variance (all observations are the same), the model will ignore them entirely.
3. Test with a Minimal, Controlled Dataset
Isolate whether the problem is with your data or the rDEA package itself by creating a small test dataset where output variables are clearly independent:
# Create test input/output matrices with distinct variables test_inp <- matrix(c(2, 3, 5, 4, 6, 7), ncol = 2, dimnames = list(NULL, c("IE", "NIE"))) test_out <- matrix(c(10, 15, 20, # L 8, 12, 16, # D 5, 7, 9, # II 3, 4, 6), # NII ncol = 4, dimnames = list(NULL, c("L", "D", "II", "NII"))) # Run DEA with 2 vs 4 output variables model_2out <- dea(XREF = test_inp, YREF = test_out[, 1:2], X = test_inp, Y = test_out[, 1:2], model = "output", RTS = "constant") model_4out <- dea(XREF = test_inp, YREF = test_out, X = test_inp, Y = test_out, model = "output", RTS = "constant") # Compare efficiency scores all.equal(model_2out$theta, model_4out$theta)
If this test returns FALSE (scores differ), the problem is specific to your original PANELDATA. If it returns TRUE, there might be a quirk in rDEA's handling of multiple outputs—try switching packages for validation.
4. Validate with an Alternative DEA Package
Use another well-maintained DEA package like Benchmarking to run the same analysis. If results change when adding L and II here, the issue is likely with rDEA:
install.packages("Benchmarking") library(Benchmarking) # Run output-oriented DEA with constant returns to scale model_bench <- dea(inp_var, out_var, orientation = "out", RTS = "c") # Compare efficiency scores with rDEA all.equal(model$theta, model_bench$eff)
If the Benchmarking results differ when adding outputs, consider reporting the issue to the rDEA package maintainers, or switch to a more robust package for your analysis.
5. Review rDEA Parameter Documentation
Double-check the rDEA dea function parameters to ensure you're not accidentally limiting variable inclusion. For example:
- Is there a hidden parameter that restricts the number of outputs?
- Does the
model="output"setting prioritize certain outputs over others?
Refer to?rDEA::deafor detailed parameter explanations.
Final Notes
DEA models are sensitive to variable selection and data quality—redundant or collinear variables won't add value to your efficiency analysis. Start with the multicollinearity check, as this is the most common cause of your issue.
内容的提问来源于stack exchange,提问作者Jessica Sköldin

