sqi_linear: Soil Quality Index: Linear Scoring Method

View source: R/indexing.R

sqi_linearR Documentation

Soil Quality Index: Linear Scoring Method

Description

Computes the Soil Quality Index (SQI) using the linear additive scoring method of Doran & Parkin (1994) and Andrews et al. (2004). Each variable score (0–1, from score_all) is averaged across replicates within each group, optionally weighted, and then min-max normalised to produce the final index.

SQI_g = \frac{\sum_{j=1}^{p} w_j \bar{S}_{gj}}{\sum_{j=1}^{p} w_j}

where \bar{S}_{gj} is the mean score of variable j in group g and w_j is the weight of variable j.

Usage

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

Arguments

scored

A scored data frame from score_all.

config

A sqi_config object (see make_config).

group_cols

Character vector of grouping column names.

mds_vars

Character vector. If supplied, only these variables are used. Otherwise all numeric variables in config are used.

weights

Named numeric vector of variable weights. Defaults to equal weights (1 for all). Names must match variable names.

Value

A data frame with group columns plus:

SQI_linear

Final normalised Soil Quality Index (0–1).

Raw_score

Weighted mean score before normalisation.

References

Doran, J.W., & Parkin, T.B. (1994). Defining and assessing soil quality. In J.W. Doran et al. (Eds.), Defining Soil Quality for a Sustainable Environment, pp. 1–21. SSSA Special Publication 35. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2136/sssaspecpub35.c1")}

Andrews, S.S., Karlen, D.L., & Cambardella, C.A. (2004). The soil management assessment framework. Soil Science Society of America Journal, 68(6), 1945–1962. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2136/sssaj2004.1945")}

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


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