| sqi_entropy | R Documentation |
Computes SQI using Shannon entropy to derive objective weights for each variable. Variables with higher information entropy (greater discriminating power among groups) receive higher weights. This removes subjectivity from weight assignment.
The entropy weight for variable j is:
e_j = -\frac{1}{\ln n} \sum_{i=1}^{n} p_{ij} \ln(p_{ij})
w_j = \frac{1 - e_j}{\sum_k (1 - e_k)}
where p_{ij} = \bar{S}_{ij} / \sum_i \bar{S}_{ij}.
sqi_entropy(scored, config, group_cols = "LandUse", mds_vars = NULL)
scored |
A scored data frame from |
config |
A |
group_cols |
Character vector of grouping column names. |
mds_vars |
Character vector of MDS variable names. |
A data frame with group columns, SQI_entropy,
and attribute entropy_weights (named numeric vector).
Shannon, C.E. (1948). A mathematical theory of communication. Bell System Technical Journal, 27(3), 379–423. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/j.1538-7305.1948.tb01338.x")}
Li, P., Qian, H., & Wu, J. (2010). Groundwater quality assessment based on improved water quality index in Pengyang County, Ningxia, Northwest China. E-Journal of Chemistry, 7, 209–216. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1155/2010/451304")}
data(soil_data)
cfg <- make_config(
variable = c("pH","EC","BD","OC","MBC","Clay"),
type = c("opt","less","less","more","more","opt"),
opt_low = c(6.0, NA, NA, NA, NA, 20),
opt_high = c(7.0, NA, NA, NA, NA, 35)
)
scored <- score_all(soil_data, cfg, group_cols = c("LandUse","Depth"))
result <- sqi_entropy(scored, cfg, group_cols = c("LandUse","Depth"))
attr(result, "entropy_weights")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.