| sqi_anova | R Documentation |
Performs a one-way ANOVA to test whether Soil Quality Index values differ significantly across land-use groups, followed by Tukey's Honest Significant Difference (HSD) test for pairwise comparisons.
sqi_anova(scored, sqi_col, group_col, alpha = 0.05)
scored |
A scored data frame from |
sqi_col |
Character. Name of the SQI column to test (e.g.,
|
group_col |
Character. Grouping variable column name (e.g.,
|
alpha |
Numeric. Significance level for the ANOVA. Default 0.05. |
A list with:
An anova object.
A TukeyHSD object.
Logical. Whether the ANOVA is significant at
alpha.
Data frame of compact letter display for plotting.
Tukey, J.W. (1949). Comparing individual means in the analysis of variance. Biometrics, 5(2), 99–114. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2307/3001913")}
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"))
# Compute per-observation linear SQI for ANOVA
scored$SQI_obs <- rowMeans(scored[, cfg$variable], na.rm = TRUE)
aov_result <- sqi_anova(scored, sqi_col = "SQI_obs",
group_col = "LandUse")
print(aov_result$tukey)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.