[R] Anova und Tukey HSD

Jochen Schreiber jocsch at googlemail.com
Mon May 13 14:25:28 CEST 2013


Hallo zusammen,

ich mache zuerst mittels eine Anova eine Überprüfung ob in den Daten ein signifikanter Unterschied exisitiert. Danach will ich mittels des TukeyHSD rausfinden, zwischen welchen Gruppe der Unterschied vorliegt. Allerdings weiß ich nicht wie ich die Daten interpretieren soll. Hier erstmal mein R Code:

[code]
Value<-c(-0.9944999814033508,-0.35850000381469727,0.7063000202178955,-1.774399995803833,-1.080299973487854,0.30550000071525574,1.8499999046325684,-0.4124999940395355,0.5827999711036682,1.7506999969482422,-6.693999767303467,-0.8779000043869019,-1.3408000469207764,1.2560999393463135,-0.10040000081062317,1.8499999046325684,-0.3319000005722046,0.4957999885082245,0.8779000043869019,0.7387999892234802,0.8779000043869019,0.9154000282287598,0.8779000043869019,0.7063000202178955,-1.3408000469207764,0.7063000202178955,-0.3319000005722046,-1.6448999643325806,0.4124999940395355,-1.6448999643325806,-0.8779000043869019,0.7487000226974487,0.4399000108242035,1.8499999046325684,-1.6448999643325806,-2.4323999881744385,1.2265000343322754,-0.4957999885082245,-9.999899864196777,-1.7506999969482422,-1.6448999643325806,-9.999899864196777,0.8779000043869019,-5.06279993057251,0.8779000043869019,-2.9677000045776367,-5.06279993057251,-6.693999767303467,-1.0990500450134277,0.9944999814033508,-0.4677000045776367,-0.35850000381469727,-9.999899864196777,0.5827999711036682,0.7487000226974487,0.7387999892234802,-0.2533000111579895,-9.999899864196777,-1.0363999605178833,0.30550000071525574,-1.1749999523162842,-0.8064000010490417,-9.999899864196777,-0.9944999814033508,-2.478300094604492,-0.1509999930858612,0.4957999885082245,-4.571800231933594,-6.324900150299072,-0.38530001044273376,-1.3408000469207764,-5.93179988861084,-6.693999767303467,-2.9677000045776367,0.8779000043869019,-0.050200000405311584,-1.774399995803833,-0.1509999930858612,-0.23725003004074097,-0.6432999968528748,1.2560999393463135,-0.10040000081062317,0.4399000108242035,-0.7063000202178955,0.9154000282287598,-0.21819999814033508,1.2265000343322754,-0.4124999940395355,0.17640000581741333,-1.4758000373840332,-0.9944999814033508,-1.080299973487854,-0.6432999968528748,-9.999899864196777,-2.0536999702453613,-0.21819999814033508,0.7487000226974487,0.025100000202655792,-1.0363999605178833,-0.050200000405311584,-0.7387999892234802,0.4957999885082245,-1.4758000373840332,-0.7063000202178955,0.17640000581741333,-5.06279993057251,-0.6432999968528748,-1.4758000373840332,-0.9944999814033508,-0.2533000111579895,0.17640000581741333,-0.3319000005722046,0.6776500344276428,0.30550000071525574,-0.050200000405311584,0.5827999711036682,1.2560999393463135,-0.4957999885082245,-0.38530001044273376,0.9944999814033508,-2.4323999881744385,1.1263999938964844,-0.9944999814033508,1.7506999969482422,1.080299973487854,-0.7387999892234802,-1.3408000469207764,0.6128000020980835,-2.0536999702453613,0.7063000202178955,-0.8064000010490417,-0.8779000043869019,-0.050200000405311584,-2.9677000045776367,-0.8779000043869019,-2.0536999702453613,-1.3408000469207764,-1.3408000469207764,-0.38530001044273376,0.7063000202178955,-9.999899864196777,-0.4677000045776367,0.7721999883651733,0.025100000202655792,1.1263999938964844,-6.324900150299072,-0.1509999930858612,-0.4399000108242035,-0.9944999814033508,-0.9944999814033508,-0.4677000045776367,-1.0363999605178833,-1.7506999969482422,1.2265000343322754,-0.8779000043869019,0.6128000020980835,-0.050200000405311584,0.5827999711036682,-0.7063000202178955,-0.6432999968528748,-0.23725003004074097,0.025100000202655792,0.4124999940395355,0.7721999883651733,-1.0990500450134277)
Value<-c(Value,0.9944999814033508,-0.2533000111579895,1.2560999393463135,-0.21819999814033508,-1.1749999523162842,-0.38530001044273376,-0.4399000108242035,-0.7063000202178955,-2.478300094604492,-2.4323999881744385,0.9154000282287598,-0.23725003004074097,-0.38530001044273376,-1.6448999643325806,-0.050200000405311584,1.8499999046325684,-0.38530001044273376,-0.6432999968528748,-4.571800231933594,-6.693999767303467,-1.7506999969482422,1.080299973487854,0.4124999940395355,-1.3408000469207764,-5.93179988861084,-0.35850000381469727,-0.6432999968528748,-0.4124999940395355,-1.0990500450134277,-0.9944999814033508,-0.8064000010490417)
Group<-factor(c(rep('D',18),rep('C',1),rep('A',7),rep('B',34),rep('E',3),rep('F',4),rep('G',10),rep('H',2),rep('I',29),rep('J',16),rep('N',1),rep('M',1),rep('Z',2),rep('X',67),rep('O',1)))
mydata<-data.frame(Group, Value)
summary(aov(Value ~Group,mydata))
TukeyHSD(aov(Value ~Group))
[/code]

Das Summary von Anova gibt folgenden Output:

[code]
            Df  Sum Sq Mean Sq F value  Pr(>F)  
Group        14  147.47 10.5339  1.8815 0.03089 *
Residuals   181 1013.38  5.5988                  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 
[/code]

Dort sehe ich das der Pr(>F)-Wert unter 0.05 liegt daher existiert ein signifikanter Unterschied. Nun folgt ein Teil der Ausgabe vom TukeyHSD:

[code]
$Group
          diff         lwr        upr     p adj
B-A -2.42876615  -5.8061007  0.9485684 0.4650621
C-A  0.38050000  -8.3184455  9.0794455 1.0000000
D-A -0.78451112  -4.4090717  2.8400495 0.9999881
E-A -4.49116661 -10.1063118  1.1239785 0.2838741
F-A -1.27940002  -6.3796089  3.8208088 0.9999272
G-A -3.41370001  -7.4237157  0.5963157 0.1940527
H-A -0.69152501  -7.2157341  5.8326841 1.0000000
I-A -1.33448620  -4.7611687  2.0921963 0.9910595
J-A -0.43914063  -4.1265855  3.2483043 1.0000000
M-A -1.23619999  -9.9351455  7.4627455 0.9999999
N-A  0.58289997  -8.1160455  9.2818454 1.0000000
O-A -1.30380000 -10.0027455  7.3951455 0.9999999
X-A -1.40412389  -4.6363376  1.8280899 0.9756749
Z-A -0.86140003  -7.3856091  5.6628091 1.0000000
C-B  2.80926615  -5.4466486 11.0651809 0.9977027
D-B  1.64425503  -0.7276462  4.0161562 0.5299872
E-B -2.06240046  -6.9632505  2.8384496 0.9816337
F-B  1.14936613  -3.1518670  5.4505992 0.9998458
G-B -0.98493386  -3.9121684  1.9423006 0.9979595
H-B  1.73724114  -4.1833822  7.6578644 0.9995457
I-B  1.09427995  -0.9625693  3.1511291 0.8829284
J-B  1.98962552  -0.4773008  4.4565519 0.2709375
M-B  1.19256616  -7.0633486  9.4484809 0.9999999
N-B  3.01166612  -5.2442486 11.2675808 0.9952989
O-B  1.12496615  -7.1309486  9.3808809 1.0000000
X-B  1.02464226  -0.6887408  2.7380253 0.7612648
[/code]

Wie sehe ich nun welche Gruppe/n den signifikanten Unterschied aufweisen? Ich meine mich zu erinnern (habe aber leider nix dergleichen gefunden), dass wenn das Intervall die 0 nicht mit einschließt ein signifikanter Unterschied besteht. Was bedeuteten würde, wenn der pwr und lwr > 0.0 oder pwr und lwr < 0.0 wären das dann ein signifikanter Unterschied da wäre. Nur habe ich das in keiner Zeile der TukeyHSD Ausgabe?

Ich denke das ist ne Kleinigkeit aber ich hoffe ihr könnt mir helfen.

Viele Grüße

bladepit


More information about the R-help mailing list