Compute Tukey Contrasts for all levels of a categorical predictor. Takes simple linear regression models and multiple linear regression models, as well as linear mixed effects models as input.

tukey(model, predictor)

Arguments

model

The model object, created by lm() or lmer().

predictor

The categorical predictor for which Tukey Contrasts should be computed.

Value

A list object if assigned to a variable name.

References

Hothorn, T., Bretz, F., & Westfall, P. (2008). Simultaneous Inference in General Parametric Models. Biometrical Journal 50(3), 346-363.

Author

D. Schmitz

Examples

data("data_s")

mdl <- lm(sDur ~ pauseBin, data = data_s)

tukey(model = mdl, predictor = pauseBin)
#> 
#> 	 Simultaneous Tests for General Linear Hypotheses
#> 
#> Multiple Comparisons of Means: Tukey Contrasts
#> 
#> 
#> Fit: lm(formula = sDur ~ pauseBin, data = data_s)
#> 
#> Linear Hypotheses:
#>                       Estimate Std. Error t value Pr(>|t|)    
#> pause - no_pause == 0 0.055883   0.007938    7.04 6.69e-11 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> (Adjusted p values reported -- single-step method)
#>