Run a contrast analysis by estimating the differences between each level of a factor. See also other related functions such as estimate_means() and estimate_slopes().

## Usage

estimate_contrasts(
model,
contrast = NULL,
at = NULL,
fixed = NULL,
transform = "none",
ci = 0.95,
method = "pairwise",
...
)

## Arguments

model

A statistical model.

contrast

A character vector indicating the name of the variable(s) for which to compute the contrasts.

at

The predictor variable(s) at which to evaluate the desired effect / mean / contrasts. Other predictors of the model that are not included here will be collapsed and "averaged" over (the effect will be estimated across them).

fixed

A character vector indicating the names of the predictors to be "fixed" (i.e., maintained), so that the estimation is made at these values.

transform

Is passed to the type argument in emmeans::emmeans(). See this vignette. Can be "none" (default for contrasts), "response" (default for means), "mu", "unlink", "log". "none" will leave the values on scale of the linear predictors. "response" will transform them on scale of the response variable. Thus for a logistic model, "none" will give estimations expressed in log-odds (probabilities on logit scale) and "response" in terms of probabilities.

ci

Confidence Interval (CI) level. Default to 0.95 (95%).

The p-values adjustment method for frequentist multiple comparisons. Can be one of "holm" (default), "tukey", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr" or "none". See the p-value adjustment section in the emmeans::test documentation.

method

Contrast method. See same argument in emmeans::contrast.

Deprecated in favour of p_adjust.

...

Other arguments passed for instance to insight::get_datagrid().

## Value

A data frame of estimated contrasts.

## Details

See the Details section below, and don't forget to also check out the Vignettes and README examples for various examples, tutorials and use cases.

The estimate_slopes(), estimate_means() and estimate_contrasts() functions are forming a group, as they are all based on marginal estimations (estimations based on a model). All three are also built on the emmeans package, so reading its documentation (for instance for emmeans::emmeans() and emmeans::emtrends()) is recommended to understand the idea behind these types of procedures.

• Model-based predictions is the basis for all that follows. Indeed, the first thing to understand is how models can be used to make predictions (see estimate_link()). This corresponds to the predicted response (or "outcome variable") given specific predictor values of the predictors (i.e., given a specific data configuration). This is why the concept of reference grid() is so important for direct predictions.

• Marginal "means", obtained via estimate_means(), are an extension of such predictions, allowing to "average" (collapse) some of the predictors, to obtain the average response value at a specific predictors configuration. This is typically used when some of the predictors of interest are factors. Indeed, the parameters of the model will usually give you the intercept value and then the "effect" of each factor level (how different it is from the intercept). Marginal means can be used to directly give you the mean value of the response variable at all the levels of a factor. Moreover, it can also be used to control, or average over predictors, which is useful in the case of multiple predictors with or without interactions.

• Marginal contrasts, obtained via estimate_contrasts(), are themselves at extension of marginal means, in that they allow to investigate the difference (i.e., the contrast) between the marginal means. This is, again, often used to get all pairwise differences between all levels of a factor. It works also for continuous predictors, for instance one could also be interested in whether the difference at two extremes of a continuous predictor is significant.

• Finally, marginal effects, obtained via estimate_slopes(), are different in that their focus is not values on the response variable, but the model's parameters. The idea is to assess the effect of a predictor at a specific configuration of the other predictors. This is relevant in the case of interactions or non-linear relationships, when the effect of a predictor variable changes depending on the other predictors. Moreover, these effects can also be "averaged" over other predictors, to get for instance the "general trend" of a predictor over different factor levels.

Example: Let's imagine the following model lm(y ~ condition * x) where condition is a factor with 3 levels A, B and C and x a continuous variable (like age for example). One idea is to see how this model performs, and compare the actual response y to the one predicted by the model (using estimate_response()). Another idea is evaluate the average mean at each of the condition's levels (using estimate_means()), which can be useful to visualize them. Another possibility is to evaluate the difference between these levels (using estimate_contrasts()). Finally, one could also estimate the effect of x averaged over all conditions, or instead within each condition (using [estimate_slopes]).

## Examples

# Basic usage
model <- lm(Sepal.Width ~ Species, data = iris)
estimate_contrasts(model)
#> No variable was specified for contrast estimation. Selecting contrast = "Species".
#> Marginal Contrasts Analysis
#>
#> Level1     |     Level2 | Difference |         95% CI |   SE | t(147) |      p
#> ------------------------------------------------------------------------------
#> setosa     | versicolor |       0.66 | [ 0.49,  0.82] | 0.07 |   9.69 | < .001
#> setosa     |  virginica |       0.45 | [ 0.29,  0.62] | 0.07 |   6.68 | < .001
#> versicolor |  virginica |      -0.20 | [-0.37, -0.04] | 0.07 |  -3.00 | 0.003
#>
#> Marginal contrasts estimated at Species
#> p-value adjustment method: Holm (1979)

# Dealing with interactions
model <- lm(Sepal.Width ~ Species * Petal.Width, data = iris)

# By default: selects first factor
estimate_contrasts(model)
#> No variable was specified for contrast estimation. Selecting contrast = "Species".
#> NOTE: Results may be misleading due to involvement in interactions
#> Marginal Contrasts Analysis
#>
#> Level1     |     Level2 | Difference |        95% CI |   SE | t(144) |      p
#> -----------------------------------------------------------------------------
#> setosa     | versicolor |       1.59 | [ 0.64, 2.54] | 0.39 |   4.04 | < .001
#> setosa     |  virginica |       1.77 | [ 0.77, 2.78] | 0.41 |   4.29 | < .001
#> versicolor |  virginica |       0.18 | [-0.17, 0.54] | 0.15 |   1.27 | 0.205
#>
#> Marginal contrasts estimated at Species
#> p-value adjustment method: Holm (1979)

# Can also run contrasts between points of numeric
estimate_contrasts(model, contrast = "Petal.Width", length = 4)
#> NOTE: Results may be misleading due to involvement in interactions
#> Marginal Contrasts Analysis
#>
#> Level1         |         Level2 | Difference |         95% CI |   SE | t(144) |      p
#> --------------------------------------------------------------------------------------
#> Petal.Width0.1 | Petal.Width0.9 |      -0.67 | [-1.02, -0.33] | 0.13 |  -5.18 | < .001
#> Petal.Width0.1 | Petal.Width1.7 |      -1.35 | [-2.04, -0.65] | 0.26 |  -5.18 | < .001
#> Petal.Width0.1 | Petal.Width2.5 |      -2.02 | [-3.06, -0.98] | 0.39 |  -5.18 | < .001
#> Petal.Width0.9 | Petal.Width1.7 |      -0.67 | [-1.02, -0.33] | 0.13 |  -5.18 | < .001
#> Petal.Width0.9 | Petal.Width2.5 |      -1.35 | [-2.04, -0.65] | 0.26 |  -5.18 | < .001
#> Petal.Width1.7 | Petal.Width2.5 |      -0.67 | [-1.02, -0.33] | 0.13 |  -5.18 | < .001
#>
#> Marginal contrasts estimated at Petal.Width
#> p-value adjustment method: Holm (1979)

# Or both
estimate_contrasts(model, contrast = c("Species", "Petal.Width"), length = 2)
#> Marginal Contrasts Analysis
#>
#> Level1                    |                    Level2 | Difference |         95% CI |   SE | t(144) |      p
#> ------------------------------------------------------------------------------------------------------------
#> setosa Petal.Width0.1     |     setosa Petal.Width2.5 |      -2.01 | [-4.92,  0.91] | 0.98 |  -2.06 | 0.166
#> setosa Petal.Width0.1     | versicolor Petal.Width0.1 |       1.83 | [ 0.99,  2.66] | 0.28 |   6.55 | < .001
#> setosa Petal.Width0.1     | versicolor Petal.Width2.5 |      -0.70 | [-1.50,  0.10] | 0.27 |  -2.61 | 0.059
#> setosa Petal.Width0.1     |  virginica Petal.Width0.1 |       1.55 | [ 0.62,  2.48] | 0.31 |   4.95 | < .001
#> setosa Petal.Width0.1     |  virginica Petal.Width2.5 |       0.03 | [-0.30,  0.37] | 0.11 |   0.29 | 0.984
#> setosa Petal.Width2.5     | versicolor Petal.Width2.5 |       1.31 | [-1.54,  4.16] | 0.95 |   1.37 | 0.517
#> setosa Petal.Width2.5     |  virginica Petal.Width2.5 |       2.04 | [-0.71,  4.79] | 0.92 |   2.21 | 0.142
#> versicolor Petal.Width0.1 |     setosa Petal.Width2.5 |      -3.84 | [-6.69, -0.98] | 0.96 |  -4.01 | < .001
#> versicolor Petal.Width0.1 | versicolor Petal.Width2.5 |      -2.53 | [-4.08, -0.98] | 0.52 |  -4.86 | < .001
#> versicolor Petal.Width0.1 |  virginica Petal.Width0.1 |      -0.28 | [-1.49,  0.93] | 0.41 |  -0.69 | 0.984
#> versicolor Petal.Width0.1 |  virginica Petal.Width2.5 |      -1.80 | [-2.64, -0.95] | 0.28 |  -6.35 | < .001
#> versicolor Petal.Width2.5 |  virginica Petal.Width2.5 |       0.73 | [-0.08,  1.55] | 0.27 |   2.70 | 0.055
#> virginica Petal.Width0.1  |     setosa Petal.Width2.5 |      -3.56 | [-6.44, -0.67] | 0.97 |  -3.68 | 0.003
#> virginica Petal.Width0.1  | versicolor Petal.Width2.5 |      -2.25 | [-3.44, -1.06] | 0.40 |  -5.64 | < .001
#> virginica Petal.Width0.1  |  virginica Petal.Width2.5 |      -1.52 | [-2.63, -0.40] | 0.37 |  -4.04 | < .001
#>
#> Marginal contrasts estimated at Species, Petal.Width
#> p-value adjustment method: Holm (1979)

# Or with custom specifications
estimate_contrasts(model, contrast = c("Species", "Petal.Width=c(1, 2)"))
#> Marginal Contrasts Analysis
#>
#> Level1                  |                  Level2 | Difference |         95% CI |   SE | t(144) |      p
#> --------------------------------------------------------------------------------------------------------
#> setosa Petal.Width1     |     setosa Petal.Width2 |      -0.84 | [-2.05,  0.38] | 0.41 |  -2.06 | 0.166
#> setosa Petal.Width1     | versicolor Petal.Width1 |       1.63 | [ 0.68,  2.59] | 0.32 |   5.09 | < .001
#> setosa Petal.Width1     | versicolor Petal.Width2 |       0.58 | [-0.45,  1.61] | 0.35 |   1.68 | 0.191
#> setosa Petal.Width1     |  virginica Petal.Width1 |       1.73 | [ 0.68,  2.78] | 0.35 |   4.93 | < .001
#> setosa Petal.Width1     |  virginica Petal.Width2 |       1.10 | [ 0.17,  2.04] | 0.31 |   3.52 | 0.005
#> setosa Petal.Width2     | versicolor Petal.Width2 |       1.42 | [-0.77,  3.60] | 0.73 |   1.94 | 0.166
#> setosa Petal.Width2     |  virginica Petal.Width2 |       1.94 | [-0.20,  4.08] | 0.72 |   2.71 | 0.038
#> versicolor Petal.Width1 |     setosa Petal.Width2 |      -2.47 | [-4.62, -0.32] | 0.72 |  -3.43 | 0.005
#> versicolor Petal.Width1 | versicolor Petal.Width2 |      -1.05 | [-1.70, -0.41] | 0.22 |  -4.86 | < .001
#> versicolor Petal.Width1 |  virginica Petal.Width1 |       0.10 | [-0.45,  0.65] | 0.19 |   0.54 | 0.589
#> versicolor Petal.Width1 |  virginica Petal.Width2 |      -0.53 | [-0.81, -0.25] | 0.09 |  -5.72 | < .001
#> versicolor Petal.Width2 |  virginica Petal.Width2 |       0.52 | [ 0.05,  0.99] | 0.16 |   3.31 | 0.007
#> virginica Petal.Width1  |     setosa Petal.Width2 |      -2.57 | [-4.76, -0.38] | 0.73 |  -3.50 | 0.005
#> virginica Petal.Width1  | versicolor Petal.Width2 |      -1.15 | [-1.83, -0.48] | 0.23 |  -5.13 | < .001
#> virginica Petal.Width1  |  virginica Petal.Width2 |      -0.63 | [-1.10, -0.17] | 0.16 |  -4.04 | < .001
#>
#> Marginal contrasts estimated at Species, Petal.Width
#> p-value adjustment method: Holm (1979)

# Can fixate the numeric at a specific value
estimate_contrasts(model, fixed = "Petal.Width")
#> No variable was specified for contrast estimation. Selecting contrast = "Species".
#> Marginal Contrasts Analysis
#>
#> Level1     |     Level2 | Petal.Width | Difference |        95% CI |   SE | t(144) |      p
#> -------------------------------------------------------------------------------------------
#> setosa     | versicolor |        1.20 |       1.59 | [ 0.64, 2.54] | 0.39 |   4.04 | < .001
#> setosa     |  virginica |        1.20 |       1.77 | [ 0.77, 2.78] | 0.41 |   4.29 | < .001
#> versicolor |  virginica |        1.20 |       0.18 | [-0.17, 0.54] | 0.15 |   1.27 | 0.205
#>
#> Marginal contrasts estimated at Species
#> p-value adjustment method: Holm (1979)

# Or modulate it
estimate_contrasts(model, at = "Petal.Width", length = 4)
#> No variable was specified for contrast estimation. Selecting contrast = "Species".
#> Marginal Contrasts Analysis
#>
#> Level1     |     Level2 | Petal.Width | Difference |        95% CI |   SE | t(144) |      p
#> -------------------------------------------------------------------------------------------
#> setosa     | versicolor |        0.10 |       1.83 | [ 1.15, 2.50] | 0.28 |   6.55 | < .001
#> setosa     | versicolor |        0.90 |       1.65 | [ 0.96, 2.35] | 0.29 |   5.74 | < .001
#> setosa     | versicolor |        1.70 |       1.48 | [ 0.03, 2.94] | 0.60 |   2.47 | 0.015
#> setosa     | versicolor |        2.50 |       1.31 | [-1.00, 3.62] | 0.95 |   1.37 | 0.172
#> setosa     |  virginica |        0.10 |       1.55 | [ 0.79, 2.30] | 0.31 |   4.95 | < .001
#> setosa     |  virginica |        0.90 |       1.71 | [ 0.93, 2.50] | 0.32 |   5.28 | < .001
#> setosa     |  virginica |        1.70 |       1.88 | [ 0.43, 3.32] | 0.60 |   3.14 | 0.004
#> setosa     |  virginica |        2.50 |       2.04 | [-0.19, 4.28] | 0.92 |   2.21 | 0.057
#> versicolor |  virginica |        0.10 |      -0.28 | [-1.26, 0.70] | 0.41 |  -0.69 | 0.492
#> versicolor |  virginica |        0.90 |       0.06 | [-0.44, 0.56] | 0.21 |   0.28 | 0.780
#> versicolor |  virginica |        1.70 |       0.40 | [ 0.12, 0.67] | 0.11 |   3.50 | 0.002
#> versicolor |  virginica |        2.50 |       0.73 | [ 0.08, 1.39] | 0.27 |   2.70 | 0.023
#>
#> Marginal contrasts estimated at Species
#> p-value adjustment method: Holm (1979)

# Standardized differences
estimated <- estimate_contrasts(lm(Sepal.Width ~ Species, data = iris))
#> No variable was specified for contrast estimation. Selecting contrast = "Species".
standardize(estimated)
#> Marginal Contrasts Analysis (standardized)
#>
#> Level1     |     Level2 | Difference |         95% CI |   SE | t(147) |      p
#> ------------------------------------------------------------------------------
#> setosa     | versicolor |       1.51 | [ 1.13,  1.89] | 0.16 |   9.69 | < .001
#> setosa     |  virginica |       1.04 | [ 0.66,  1.42] | 0.16 |   6.68 | < .001
#> versicolor |  virginica |      -0.47 | [-0.85, -0.09] | 0.16 |  -3.00 | 0.003
#>
#> Marginal contrasts estimated at Species
#> p-value adjustment method: Holm (1979)
# Other models (mixed, Bayesian, ...)
data <- iris
data$Petal.Length_factor <- ifelse(data$Petal.Length < 4.2, "A", "B")

model <- lme4::lmer(Sepal.Width ~ Species + (1 | Petal.Length_factor), data = data)
estimate_contrasts(model)
#> No variable was specified for contrast estimation. Selecting contrast = "Species".
#> Cannot use mode = "kenward-roger" because *pbkrtest* package is not installed
#> Cannot use mode = "satterthwaite" because *lmerTest* package is not installed
#> Marginal Contrasts Analysis
#>
#> Level1     |     Level2 | Difference |        95% CI |   SE |  df |     z |      p
#> ----------------------------------------------------------------------------------
#> setosa     | versicolor |       0.87 | [ 0.66, 1.08] | 0.09 | Inf | 10.11 | < .001
#> setosa     |  virginica |       0.80 | [ 0.53, 1.07] | 0.11 | Inf |  7.11 | < .001
#> versicolor |  virginica |      -0.07 | [-0.25, 0.10] | 0.07 | Inf | -1.00 | 0.318
#>
#> Marginal contrasts estimated at Species
#> p-value adjustment method: Holm (1979)
library(rstanarm)
#> This is rstanarm version 2.21.3
#> - See https://mc-stan.org/rstanarm/articles/priors for changes to default priors!
#> - Default priors may change, so it's safest to specify priors, even if equivalent to the defaults.
#> - For execution on a local, multicore CPU with excess RAM we recommend calling
#>   options(mc.cores = parallel::detectCores())

data <- mtcars
data$cyl <- as.factor(data$cyl)
data$am <- as.factor(data$am)
# \dontrun{
model <- stan_glm(mpg ~ cyl * am, data = data, refresh = 0)
estimate_contrasts(model)
#> Warning: Could not recover model data from environment. Please make sure your
#>   data is available in your workspace.
#>   Trying to retrieve data from the model frame now.
#> No variable was specified for contrast estimation. Selecting contrast = "cyl".
#> NOTE: Results may be misleading due to involvement in interactions
#> Marginal Contrasts Analysis
#>
#> Level1 | Level2 | Difference |        95% CI |     pd | % in ROPE
#> -----------------------------------------------------------------
#> cyl4   |   cyl6 |       5.67 | [2.53,  8.96] |   100% |        0%
#> cyl4   |   cyl8 |      10.27 | [6.95, 13.63] |   100% |        0%
#> cyl6   |   cyl8 |       4.58 | [1.08,  7.84] | 99.48% |        0%
#>
#> Marginal contrasts estimated at cyl
estimate_contrasts(model, fixed = "am")
#> Warning: Could not recover model data from environment. Please make sure your
#>   data is available in your workspace.
#>   Trying to retrieve data from the model frame now.
#> No variable was specified for contrast estimation. Selecting contrast = "cyl".
#> Marginal Contrasts Analysis
#>
#> Level1 | Level2 | am | Difference |         95% CI |     pd | % in ROPE
#> -----------------------------------------------------------------------
#> cyl4   |   cyl6 |  0 |       3.77 | [-1.00,  8.71] | 94.50% |     1.00%
#> cyl4   |   cyl8 |  0 |       7.81 | [ 3.79, 11.91] |   100% |        0%
#> cyl6   |   cyl8 |  0 |       4.08 | [ 0.30,  7.59] | 98.05% |        0%
#>
#> Marginal contrasts estimated at cyl

model <- stan_glm(mpg ~ cyl * wt, data = data, refresh = 0)
estimate_contrasts(model)
#> Warning: Could not recover model data from environment. Please make sure your
#>   data is available in your workspace.
#>   Trying to retrieve data from the model frame now.
#> No variable was specified for contrast estimation. Selecting contrast = "cyl".
#> NOTE: Results may be misleading due to involvement in interactions
#> Marginal Contrasts Analysis
#>
#> Level1 | Level2 | Difference |        95% CI |     pd | % in ROPE
#> -----------------------------------------------------------------
#> cyl4   |   cyl6 |       2.25 | [-1.30, 5.77] | 89.65% |     1.71%
#> cyl4   |   cyl8 |       4.76 | [ 1.09, 8.38] | 99.55% |        0%
#> cyl6   |   cyl8 |       2.52 | [-0.46, 5.16] | 95.28% |     1.42%
#>
#> Marginal contrasts estimated at cyl
estimate_contrasts(model, fixed = "wt")
#> Warning: Could not recover model data from environment. Please make sure your
#>   data is available in your workspace.
#>   Trying to retrieve data from the model frame now.
#> No variable was specified for contrast estimation. Selecting contrast = "cyl".
#> Marginal Contrasts Analysis
#>
#> Level1 | Level2 |   wt | Difference |        95% CI |     pd | % in ROPE
#> ------------------------------------------------------------------------
#> cyl4   |   cyl6 | 3.22 |       2.25 | [-1.30, 5.77] | 89.65% |     1.71%
#> cyl4   |   cyl8 | 3.22 |       4.76 | [ 1.09, 8.38] | 99.55% |        0%
#> cyl6   |   cyl8 | 3.22 |       2.52 | [-0.46, 5.16] | 95.28% |     1.42%
#>
#> Marginal contrasts estimated at cyl
estimate_contrasts(model, at = "wt", length = 4)
#> Warning: Could not recover model data from environment. Please make sure your
#>   data is available in your workspace.
#>   Trying to retrieve data from the model frame now.
#> No variable was specified for contrast estimation. Selecting contrast = "cyl".
#> Marginal Contrasts Analysis
#>
#> Level1 | Level2 |   wt | Difference |          95% CI |     pd | % in ROPE
#> --------------------------------------------------------------------------
#> cyl4   |   cyl6 | 1.51 |       6.01 | [ -3.50, 15.55] | 90.30% |     0.92%
#> cyl4   |   cyl8 | 1.51 |       9.92 | [  4.55, 15.13] | 99.98% |        0%
#> cyl6   |   cyl8 | 1.51 |       3.89 | [ -6.18, 13.71] | 78.10% |     1.32%
#> cyl4   |   cyl6 | 2.82 |       3.16 | [ -0.13,  6.51] | 97.00% |     0.87%
#> cyl4   |   cyl8 | 2.82 |       5.99 | [  2.61,  9.22] | 99.90% |        0%
#> cyl6   |   cyl8 | 2.82 |       2.86 | [ -0.82,  6.32] | 93.88% |     1.16%
#> cyl4   |   cyl6 | 4.12 |       0.29 | [ -7.45,  7.99] | 53.02% |     2.32%
#> cyl4   |   cyl8 | 4.12 |       1.95 | [ -3.17,  7.64] | 78.12% |     2.08%
#> cyl6   |   cyl8 | 4.12 |       1.75 | [ -4.27,  7.79] | 71.83% |     2.13%
#> cyl4   |   cyl6 | 5.42 |      -2.59 | [-17.91, 12.66] | 64.00% |     1.11%
#> cyl4   |   cyl8 | 5.42 |      -1.98 | [-10.72,  7.20] | 67.75% |     1.50%
#> cyl6   |   cyl8 | 5.42 |       0.78 | [-12.07, 13.76] | 54.57% |     1.58%
#>
#> Marginal contrasts estimated at cyl

model <- stan_glm(Sepal.Width ~ Species + Petal.Width + Petal.Length, data = iris, refresh = 0)
estimate_contrasts(model, at = "Petal.Length", test = "bf")
#> No variable was specified for contrast estimation. Selecting contrast = "Species".
#> Warning: Prior not specified! Please provide the original model to get meaningful results.
#> Warning: Bayes factors might not be precise.
#> For precise Bayes factors, sampling at least 40,000 posterior samples is recommended.
#> Marginal Contrasts Analysis
#>
#> Level1     |     Level2 | Petal.Length | Difference |       95% CI |   BF
#> -------------------------------------------------------------------------
#> setosa     | versicolor |         1.00 |       1.72 | [1.37, 2.07] | 1.00
#> setosa     |  virginica |         1.00 |       2.14 | [1.61, 2.65] | 1.00
#> versicolor |  virginica |         1.00 |       0.41 | [0.21, 0.63] | 1.00
#> setosa     | versicolor |         1.66 |       1.72 | [1.37, 2.07] | 1.00
#> setosa     |  virginica |         1.66 |       2.14 | [1.61, 2.65] | 1.00
#> versicolor |  virginica |         1.66 |       0.41 | [0.21, 0.63] | 1.00
#> setosa     | versicolor |         2.31 |       1.72 | [1.37, 2.07] | 1.00
#> setosa     |  virginica |         2.31 |       2.14 | [1.61, 2.65] | 1.00
#> versicolor |  virginica |         2.31 |       0.41 | [0.21, 0.63] | 1.00
#> setosa     | versicolor |         2.97 |       1.72 | [1.37, 2.07] | 1.00
#> setosa     |  virginica |         2.97 |       2.14 | [1.61, 2.65] | 1.00
#> versicolor |  virginica |         2.97 |       0.41 | [0.21, 0.63] | 1.00
#> setosa     | versicolor |         3.62 |       1.72 | [1.37, 2.07] | 1.00
#> setosa     |  virginica |         3.62 |       2.14 | [1.61, 2.65] | 1.00
#> versicolor |  virginica |         3.62 |       0.41 | [0.21, 0.63] | 1.00
#> setosa     | versicolor |         4.28 |       1.72 | [1.37, 2.07] | 1.00
#> setosa     |  virginica |         4.28 |       2.14 | [1.61, 2.65] | 1.00
#> versicolor |  virginica |         4.28 |       0.41 | [0.21, 0.63] | 1.00
#> setosa     | versicolor |         4.93 |       1.72 | [1.37, 2.07] | 1.00
#> setosa     |  virginica |         4.93 |       2.14 | [1.61, 2.65] | 1.00
#> versicolor |  virginica |         4.93 |       0.41 | [0.21, 0.63] | 1.00
#> setosa     | versicolor |         5.59 |       1.72 | [1.37, 2.07] | 1.00
#> setosa     |  virginica |         5.59 |       2.14 | [1.61, 2.65] | 1.00
#> versicolor |  virginica |         5.59 |       0.41 | [0.21, 0.63] | 1.00
#> setosa     | versicolor |         6.24 |       1.72 | [1.37, 2.07] | 1.00
#> setosa     |  virginica |         6.24 |       2.14 | [1.61, 2.65] | 1.00
#> versicolor |  virginica |         6.24 |       0.41 | [0.21, 0.63] | 1.00
#> setosa     | versicolor |         6.90 |       1.72 | [1.37, 2.07] | 1.00
#> setosa     |  virginica |         6.90 |       2.14 | [1.61, 2.65] | 1.00
#> versicolor |  virginica |         6.90 |       0.41 | [0.21, 0.63] | 1.00
#>
#> Marginal contrasts estimated at Species
# }