0

I found one similar question here but i think my problem is if i interpret my data right.

I do my simple anova and found that in my data i have an significant different (p.value < 0.05:

an<-aov(Value ~ Group, data=mydata)

Then i do my TukeyHSD:

TukeyHSD(an)

and my output looks like that:

Tukey multiple comparisons of means
95% family-wise confidence level

Fit: aov(formula = Value ~ Group, data = kwdata)

            diff         lwr        upr     p adj
X-A     -3.15668041  -8.0916672  1.7783064 0.6646288
C-A     -2.07921381  -5.0632490  0.9048214 0.5209910
D-A      0.54997509  -1.8916800  2.9916302 0.9999804
w-X      3.79964159  -3.6284972 11.2277804 0.9108728
D-C      2.62918890  -0.5801339  5.8385117 0.2473717

If i unterstand it right the combination of my groups with the lwr-value which is over 0.0 is the group which has the highest significant difference. Is this right?

I am not sure how i could detect the groups which has a significant difference from the tukeyhsd.

This output are only a few lines from the real output. My task is to analyse multi groups and to detect the groups which has the significant difference.

Edit:

Now an complete example:

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))

My questions are:

  1. How can i detect the significant difference? With the p adj column and if how?
  2. (Additional Questions) Can i execute Tukey and then execute pairwise.wilcoxon and get the cut-set of the groups which have a significant different. Is this a robuster way in the statistics?
bladepit
  • 853
  • 5
  • 14
  • 29
  • try searching for "[r] tukeyhsd" on stackoverflow. I answered a question recently that should give you a good start. (By the way, picking out pairwise comparisons with significant effects and ignoring the rest is often bad statistical practice ...) – Ben Bolker May 10 '13 at 14:32
  • ok i think i have a big mistake in my task...i thought that i do pairwise comparisons....i've looked at an question here but it didnt help me... – bladepit May 10 '13 at 15:13
  • can you please post a reproducible example? http://tinyurl.com/reproducible-000 . If you want you can copy the example from http://stackoverflow.com/questions/16470404/tukeyhsd-adjusted-p-value-is-0-0000000/16471613#16471613 , although you might want to use an example where there are some significant and some non-significant comparisons – Ben Bolker May 10 '13 at 15:22
  • or maybe your question is "how do I read the output to determine which pairwise comparisons are significant?" in which case the answers are (1) those for which the `p adj` column shows a value of <0.05 (or whatever your chosen alpha-level is) and (2) this isn't really a programming/stack overflow question, try on http://stats.stackexchange.com ... – Ben Bolker May 10 '13 at 15:24
  • yeah that was one of my questions i think but i think my question is not very good so i will try a new example with all the example code – bladepit May 10 '13 at 15:29

1 Answers1

0

i think you can access the names of the different groups using dimnames.

based on your example, testing the second group

tR <- TukeyHSD(aov(Value ~Group))

if( tR$Groups[2,4] < 0.05 ) {   
   paste("Group", dimnames(tR$Groups)[[1]][2] , "has a Probablity of" , tR$Groups[2, 4])
}
Manuel Pasieka
  • 151
  • 1
  • 1
  • 10