sqi_topsis: Soil Quality Index: TOPSIS Method

View source: R/indexing.R

sqi_topsisR Documentation

Soil Quality Index: TOPSIS Method

Description

Computes SQI using the Technique for Order of Preference by Similarity to Ideal Solution (TOPSIS), a multi-criteria decision analysis method. Each group is ranked by its Euclidean distance to the positive ideal solution (all scores = 1) and negative ideal solution (all scores = 0).

C_i^* = \frac{d_i^-}{d_i^+ + d_i^-}

where d_i^+ and d_i^- are distances to the positive and negative ideal solutions. C_i^* \in [0, 1] with higher values indicating better soil quality.

Usage

sqi_topsis(
  scored,
  config,
  group_cols = "LandUse",
  mds_vars = NULL,
  weights = NULL
)

Arguments

scored

A scored data frame from score_all.

config

A sqi_config object.

group_cols

Character vector of grouping column names.

mds_vars

Character vector of MDS variable names.

weights

Named numeric vector of criteria weights. Defaults to equal weights.

Value

A data frame with group columns and SQI_topsis (0–1).

References

Hwang, C.L., & Yoon, K. (1981). Multiple Attribute Decision Making: Methods and Applications. Springer, Berlin. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-642-48318-9")}

Yoon, K. (1987). A reconciliation among discrete compromise solutions. Journal of the Operational Research Society, 38, 277–286. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1057/jors.1987.44")}

Examples

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_topsis(scored, cfg, group_cols = c("LandUse","Depth"))
print(result)


SQIpro documentation built on April 20, 2026, 5:06 p.m.