rstatisticsanalysisanovatukey

TukeyHSD Subscript out of bounds


I'm getting an error with TukeyHSD after running a seemingly simple ANOVA.

My data structure is in the following example format, with a total of 5 groups in my actual data:

data_frame:
A          B 
Group 1    2
Group 1    3
Group 1    5
Group 2    1
Group 2    7
Group 2    8

Results below are from * actual output from my data, not from example above *

aov(VA~as.factor(Etiologies),data_frame)
                          as.factor(Etiologies)     Residuals
Sum of Squares               37.85416               110.45051
Deg. of Freedom                     5                  81

Residual standard error: 1.167727
Estimated effects may be unbalanced

 summary(ANOVA_finalVA_all)
                               Df Sum Sq Mean Sq F value  Pr(>F)    
        as.factor(Etiologies)  5  37.85   7.571   5.552 0.00019 ***
         Residuals             81 110.45   1.364                    
        ---

Then when I run Tukey HSD I get the following error

TukeyHSD(ANOVA_finalVA_all)
Error in FUN(X[[i]], ...) : subscript out of bounds

The error traceback:

8. lapply(args, "[[", "coefficients")
7. combine_mtables(...)
6. c.mtable(`Grand mean` = gmtable, tables)
5. c(`Grand mean` = gmtable, tables)
4. model.tables.aov(x, "means")
3. model.tables(x, "means")
2. TukeyHSD.aov(ANOVA_finalVA_all)
1. TukeyHSD(ANOVA_finalVA_all)

Something I guess is wrong with the "coefficients"? Here is the coefficients produced from the ANOVA table

(Intercept)         Anova_VA_atFinal$EtiologiesA         Anova_VA_atFinal$EtiologiesB
1.73910734                           -0.78246714                            1.26089266 
Anova_VA_atFinal$EtiologiesC        Anova_VA_atFinal$EtiologiesD        Anova_VA_atFinal$EtiologiesE 
        0.07053282                            0.07662614                            1.09099566 

From what I can tell this seems like normal ANOVA behavior, and I have ensured that my Group variables are factors. I cannot seem to figure out why I am getting this error despite a normal ANOVA result. Any help in troubleshooting this error would be greatly appreciated!


Solution

  • The problem lies with the package memisc, detach package before use and this error can be avoided.