1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
R version 2.4.0 (2006-10-03)
Copyright (C) 2006 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
>
> library("multcomp")
Loading required package: mvtnorm
>
> set.seed(290875)
>
> data("warpbreaks")
> fm1 <- aov(breaks ~ wool * tension, data = warpbreaks)
>
> TukeyHSD(fm1, "tension", ordered = FALSE)
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = breaks ~ wool * tension, data = warpbreaks)
$tension
diff lwr upr p adj
M-L -10.000000 -18.81965 -1.180353 0.0228554
H-L -14.722222 -23.54187 -5.902575 0.0005595
H-M -4.722222 -13.54187 4.097425 0.4049442
> confint(glht(fm1, linfct = mcp(tension = "Tukey")))
Simultaneous Confidence Intervals for General Linear Hypotheses
Multiple Comparisons of Means: Tukey Contrasts
Fit: aov(formula = breaks ~ wool * tension, data = warpbreaks)
Estimated Quantile = 2.4186
Linear Hypotheses:
Estimate lwr upr
M - L == 0 -10.0000 -18.8202 -1.1798
H - L == 0 -14.7222 -23.5425 -5.9020
H - M == 0 -4.7222 -13.5425 4.0980
95% family-wise confidence level
> summary(glht(fm1, linfct = mcp(tension = "Tukey")))
Simultaneous Tests for General Linear Hypotheses
Multiple Comparisons of Means: Tukey Contrasts
Fit: aov(formula = breaks ~ wool * tension, data = warpbreaks)
Linear Hypotheses:
Estimate Std. Error t value p value
M - L == 0 -10.000 3.647 -2.742 0.0228 *
H - L == 0 -14.722 3.647 -4.037 <0.001 ***
H - M == 0 -4.722 3.647 -1.295 0.4050
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Adjusted p values reported)
>
> TukeyHSD(fm1, "wool", ordered = FALSE)
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = breaks ~ wool * tension, data = warpbreaks)
$wool
diff lwr upr p adj
B-A -5.777778 -11.76458 0.2090243 0.058213
> confint(glht(fm1, linfct = mcp(wool = "Tukey")))
Simultaneous Confidence Intervals for General Linear Hypotheses
Multiple Comparisons of Means: Tukey Contrasts
Fit: aov(formula = breaks ~ wool * tension, data = warpbreaks)
Estimated Quantile = 2.0106
Linear Hypotheses:
Estimate lwr upr
B - A == 0 -5.7778 -11.7646 0.2090
95% family-wise confidence level
> summary(glht(fm1, linfct = mcp(wool = "Tukey")))
Simultaneous Tests for General Linear Hypotheses
Multiple Comparisons of Means: Tukey Contrasts
Fit: aov(formula = breaks ~ wool * tension, data = warpbreaks)
Linear Hypotheses:
Estimate Std. Error t value p value
B - A == 0 -5.778 2.978 -1.94 0.0582 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Adjusted p values reported)
>
|