sqi_regression: Soil Quality Index: Regression-Based Method

View source: R/indexing.R

sqi_regressionR Documentation

Soil Quality Index: Regression-Based Method

Description

Computes the SQI using stepwise multiple linear regression to identify and weight the most predictive soil variables. The dependent variable (e.g., crop yield, total biomass) determines which variables enter the model. Regression coefficients serve as weights in the index.

This follows the method described by Masto et al. (2008) and Mukherjee & Lal (2014).

Usage

sqi_regression(
  scored,
  config,
  dep_var,
  group_cols = "LandUse",
  mds_vars = NULL,
  direction = "both"
)

Arguments

scored

A scored data frame from score_all.

config

A sqi_config object.

dep_var

Character. Name of the dependent variable column in scored.

group_cols

Character vector of grouping column names.

mds_vars

Character vector of candidate predictor variable names. If NULL, all variables in config are used.

direction

Character. Direction for stepwise selection: "both" (default), "forward", or "backward".

Value

A data frame with group columns plus:

SQI_regression

Normalised SQI (0–1).

selected_vars

(attribute) Character vector of selected predictors.

References

Masto, R.E., Chhonkar, P.K., Singh, D., & Patra, A.K. (2008). Alternative soil quality indices. Environmental Monitoring and Assessment, 136, 419–435. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s10661-007-9697-z")}

Mukherjee, A., & Lal, R. (2014). Comparison of soil quality index using three methods. PLOS ONE, 9(8), e105981. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1371/journal.pone.0105981")}

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"))
# OC used as surrogate dependent variable
result <- sqi_regression(scored, cfg, dep_var = "OC",
                         group_cols = c("LandUse","Depth"))
print(result)


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