
Biological Ranking and Effect Size Quantification for Treatments
Source:R/agri_ranking.R
agri_ranking.RdComputes hierarchical agronomic rankings, percentage gains/losses relative to a control, absolute differences, and standardized effect sizes (Cohen's d) integrated with post-hoc significance groups.
Arguments
- fit
An object of class `"agri_fitted_model"` or `"agri_posthoc"`.
- trt
Optional character string or vector specifying treatment factor(s) to rank.
- control
Optional character string specifying the control / benchmark level (e.g., `"N0_Control"`, `"Control_22C"`, `"G1"`). If `NULL`, auto-detected by naming conventions.
- higher_is_better
Logical, whether higher values represent superior performance (default = `TRUE`).
- method
Post-hoc method to compute significance letters (default = `"tukey"`).
Value
An S3 object of class `"agri_ranking"` containing:
- ranking_table
Data frame sorted by biological performance containing rank, treatment level(s), estimated mean/median, standard error, percentage change (%), absolute delta, Cohen's d, and significance group.
- control_level
Name of the benchmark / control level used.
- top_performer
Top-ranked treatment level and its percentage superiority.
- factor_name
Treatment factor(s) evaluated.
Examples
data(tomato_rcbd, package = "agriDesignR")
fit <- fit_experiment(
data = tomato_rcbd,
response = "fruit_weight",
treatment = "treatment",
block = "block"
)
rnk <- agri_ranking(fit, trt = "treatment", control = "N0_Control")
#> Note: adjust = "tukey" was changed to "sidak"
#> because "tukey" is only appropriate for one set of pairwise comparisons
print(rnk)
#>
#> ======================================================================
#> agriDesignR: Biological Ranking & Effect Size Engine
#> ======================================================================
#> Treatment Factor: treatment
#> Benchmark/Ctrl : N0_Control
#> Top Performer : N100 (+26.27% vs control)
#>
#>
#> Hierarchical Performance Ranking Table
#> ----------------------------------------------------------------------
#> Rank treatment Mean_Estimate SE Delta_vs_Ctrl Percent_Gain Cohen_d Group
#> 1 N100 124.637 2.901 25.931 26.27 4.54 c
#> 2 N150 121.772 2.805 23.066 23.37 4.04 c
#> 3 N50 109.183 2.901 10.477 10.61 1.84 b
#> 4 N0_Control 98.706 2.805 0.000 0.00 0.00 a
#>
#> ======================================================================
#> Legend: Delta_vs_Ctrl = Absolute mean difference vs. benchmark
#> Percent_Gain = Relative percentage superiority / reduction
#> Cohen_d = Standardized effect size (|d| > 0.8 is strong)
#>