sqi_pca: Soil Quality Index: PCA-Based Method

View source: R/indexing.R

sqi_pcaR Documentation

Soil Quality Index: PCA-Based Method

Description

Computes SQI using Principal Component Analysis, weighting selected MDS variables by the proportion of variance their component explains. This is the most widely cited data-driven approach in soil quality research (Andrews et al., 2004; Bastida et al., 2008).

SQI_{PCA} = \sum_{k=1}^{m} \frac{V_k}{\sum V} \bar{S}_{g, j_k}

where V_k is the variance explained by component k, j_k is the MDS variable selected from component k, and \bar{S}_{g, j_k} is the group mean score of that variable.

Usage

sqi_pca(scored, config, group_cols = "LandUse", mds = NULL)

Arguments

scored

A scored data frame from score_all.

config

A sqi_config object.

group_cols

Character vector of grouping column names.

mds

Object returned by select_mds. If NULL, select_mds is run internally with default parameters.

Value

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

References

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")}

Bastida, F., Zsolnay, A., Hernandez, T., & Garcia, C. (2008). Past, present and future of soil quality indices: A biological perspective. Geoderma, 147(3–4), 159–171. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.geoderma.2008.08.007")}

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


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