| sqi_regression | R Documentation |
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).
sqi_regression(
scored,
config,
dep_var,
group_cols = "LandUse",
mds_vars = NULL,
direction = "both"
)
scored |
A scored data frame from |
config |
A |
dep_var |
Character. Name of the dependent variable column in
|
group_cols |
Character vector of grouping column names. |
mds_vars |
Character vector of candidate predictor variable names.
If |
direction |
Character. Direction for stepwise selection:
|
A data frame with group columns plus:
Normalised SQI (0–1).
(attribute) Character vector of selected predictors.
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")}
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.