Function to calculate the means using Linear models (lm or aov)

means_lm(
  data,
  trait,
  model,
  comparison,
  test = "SNK",
  anova = FALSE,
  plot_diag = FALSE,
  plot_treat = NULL,
  plot_groups = NULL,
  tab_vars = NULL,
  sep = NULL,
  digits = 3
)

Arguments

data

Experimental design data frame with the factors and traits.

trait

Name of the trait.

model

The effects in the model. See examples.

comparison

Factor for the comparisons.

test

Test comparison (default = "SNK"). Others: "TUKEY" & "DUNCAN".

anova

ANOVA table (default = FALSE).

plot_diag

Show diagnostic plots (default = FALSE).

plot_treat

Treat of comparison in dot plot (default = NULL). See example.

plot_groups

Group of comparison in dot plot (default = NULL). See example.

tab_vars

Specific the variables in the summary table (default = NULL).

sep

Separator between the variables when use tab_vars. See details.

digits

Number of digits in the table (default = 3).

Value

A list with two objects:

1. Summary statistics.

2. Means with the mean comparisons test.

Details

Using tab_vars select the variables shown the adjusted mean table with the sep. Mean comparison at p < 0.05.