pairwise_comparison: Pairwise Tukey Comparisons

View source: R/pairwise_comparison.R

pairwise_comparisonR Documentation

Pairwise Tukey Comparisons

Description

pairwise_comparison computes pairwise Tukey comparisons for any combination of variables in a given QGAM using the emmeans package. Pairwise Tukey comparisons are most sensible to check differences between levels of a categorical predictor.

Usage

pairwise_comparison(
  qgam,
  quantile = NULL,
  factor, by = NULL,
  ...)

Arguments

qgam

A qgam object created with qgam::qgam or extracted from a qgam::mqgam object, or a collection of qgams created with qgam::mqgam.

quantile

If qgam is a collection of qgam models, specify the quantile you are interested in. Not meaningful for single qgam objects.

factor

The categorical variable you wish to compute Tukey comparisons for. Must be one of the predictor or smooth terms given in the qgam formula.

...

Any of the other arguments emmeans::emmeans can take.

Author(s)

D. Schmitz

References

Russell V. Lenth (2021). emmeans: Estimated Marginal Means, aka Least-Squares Means. R package version 1.5.4. https://CRAN.R-project.org/package=emmeans

Examples


pairwise_comparison(qgam = mtqgam_mqgam, quantile = 0.5, "factor_1")


dosc91/mtqgam documentation built on Sept. 29, 2023, 9:38 a.m.