Skip to contents

The `compute_scheffe` function executes a rigorous, high-precision post-hoc mean separation analysis using Scheffe's method.

Usage

compute_scheffe(
  data,
  trait,
  anova_results,
  total_replications,
  alpha = 0.05,
  reporting_level = 2
)

Arguments

data

A verified data.frame containing the columns Genotype and the phenotypic trait under evaluation.

trait

A single character string specifying the column name of the target trait.

anova_results

A structured list derived from upstream ANOVA layouts.

total_replications

An integer specifying the absolute number of replication blocks (\(r\)).

alpha

A numeric value defining the Type-I error rate ceiling threshold. Defaults to 0.05.

reporting_level

An integer vector flag defining console trace settings. Defaults to 2.

Value

A structured named list of class "list" containing 4 computational components:

scheffe_critical_value

The absolute calculated scalar threshold value of Scheffe's adjustment.

sed

The isolated Standard Error of Difference (SED).

comparison_matrix

A detailed data frame or NULL layout reserved for pairwise lines differences.

ranked_means

A structured data frame containing sorted treatment means and significance group letters (Scheffe_Letters).

Author

Faheem Khan (2022ag94@uaf.edu.pk)

Examples

data(gv_data, package = "AgriDataTools")
reps <- length(unique(gv_data$Replication))

model_fit <- aov(PH ~ Genotype + Replication, data = gv_data)
anova_summary <- summary(model_fit)[[1]]

mock_anova <- list(
  anova_table = data.frame(
    Source = c("Genotype", "Replication", "Error"),
    Df = anova_summary$Df,
    MS = anova_summary$`Mean Sq`,
    stringsAsFactors = FALSE
  )
)

scheffe_output <- compute_scheffe(
  data = gv_data,
  trait = "PH",
  anova_results = mock_anova,
  total_replications = reps
)
print(scheffe_output$ranked_means)
#>    Genotype      Mean Scheffe_Letters
#> 1       G16 103.66667               a
#> 2        G7 100.83333              ab
#> 3        G3 100.66667              ab
#> 4       G25  99.66667             abc
#> 5       G27  99.66667             abc
#> 6        G9  99.16667             abc
#> 7        G2  97.50000             abc
#> 8       G20  97.30000             abc
#> 9       G11  96.66667             abc
#> 10      G13  96.33333             abc
#> 11      G18  95.33333             abc
#> 12      G14  95.00000             abc
#> 13      G23  95.00000             abc
#> 14       G5  94.33333             abc
#> 15      G29  93.66667             abc
#> 16      G31  93.66667             abc
#> 17      G33  93.50000             abc
#> 18      G21  93.33333             abc
#> 19       G1  92.66667             abc
#> 20      G22  92.66667             abc
#> 21      G38  92.66667             abc
#> 22      G26  92.33333             abc
#> 23       G8  92.00000             abc
#> 24      G15  91.83333             abc
#> 25      G17  91.66667             abc
#> 26      G30  91.66667             abc
#> 27      G40  91.66667             abc
#> 28      G37  91.00000             abc
#> 29      G24  90.50000             abc
#> 30       G4  90.50000             abc
#> 31       G6  89.83333             abc
#> 32      G39  89.66667             abc
#> 33      G32  89.00000             abc
#> 34      G36  89.00000             abc
#> 35      G19  87.66667              bc
#> 36      G12  87.33333              bc
#> 37      G34  87.33333              bc
#> 38      G10  87.00000              bc
#> 39      G28  84.83333               c
#> 40      G35  84.33333               c