Skip to contents

Assigns significance letters to treatment means when only the means, the error mean square and its degrees of freedom are available (for example from a published table or from another program). Uses the same tests as perform_posthoc.

Usage

compare_means(
  means,
  mse,
  df_error,
  reps,
  method = "lsd",
  alpha = 0.05,
  verbose = TRUE
)

Arguments

means

Named numeric vector of treatment means.

mse

Error mean square from the ANOVA.

df_error

Error degrees of freedom.

reps

Number of replications per mean: a single number or a vector with one value per mean.

method

One of "lsd", "duncan", "tukey", "snk", "scheffe" or "bonferroni".

alpha

Significance level. Default 0.05.

verbose

Logical. If TRUE (default), prints the table.

Value

The comparison object described in perform_posthoc: groups, table, comparisons, critical_range and statistics.

Examples

m <- c(T1 = 1180, T2 = 1265, T3 = 1342, T4 = 1410, T5 = 1238)
compare_means(m, mse = 3600, df_error = 12, reps = 4, method = "duncan")
#> 
#> Duncan's MRT (alpha = 0.05, error df = 12)
#> Critical ranges: p=2 92.439, p=3 96.757, p=4 99.374, p=5 101.105
#>  level mean SE group n
#>     T4 1410 30     a 4
#>     T3 1342 30    ab 4
#>     T2 1265 30    bc 4
#>     T5 1238 30     c 4
#>     T1 1180 30     c 4
#> 
#> Means sharing a letter do not differ significantly.