0

I have this data:

a <- c(12, 14, 16, 12, 14, 16, 12, 14, 16)
b <- c(107.13, 83.01,  164.01, 113.01, 85.48,  86.08,  112.96, 82.18,  51.92)

a is the factor with 3 levels 12, 14 and 16 and b is my response variable

When I try to run and plot pairs.anova

pairw.anova(y=a, x=b,  conf.level = 0.95, method = "tukey", MSE = NULL, df.err = NULL)

I get this error:

dims [product 0] do not match the length of object [1]

Do you know why is it?

Thanks for your help.

henrik_ibsen
  • 763
  • 1
  • 7
  • 16
javier J
  • 1
  • 1

1 Answers1

0

Maybe you could just swap the values of your arugments, since the response variable (quantitative) is probably b, and your categorical vector containing the groups is probably a.

And you have to ensure a is a factor:

library(asbio)

pairw.anova(y=b, x=factor(a),  conf.level = 0.95, 
            method = "tukey", MSE = NULL, df.err = NULL)

95% Tukey-Kramer confidence intervals 

               Diff      Lower    Upper Decision Adj. p-value
mu12-mu14  27.47667  -55.80207 110.7554   FTR H0     0.596586
mu12-mu16  10.36333   -72.9154 93.64207   FTR H0     0.923774
mu14-mu16 -17.11333 -100.39207  66.1654   FTR H0     0.809506
Edward
  • 10,360
  • 2
  • 11
  • 26
  • Hi Edward, yes you were right my mistake when I was typing, I did that that you show but I am still having the same problem. – javier J Mar 13 '20 at 06:09
  • Yes - I forgot to tell you to change `a` to a factor. Sorry about that! – Edward Mar 13 '20 at 06:18
  • Hi, hoping that everything is going well. I did that but I have the same problem, which libraries are you using? Thanks – javier J Mar 27 '20 at 01:52
  • I'm doing very well thanks! Umm, which libraries? Gosh, so long ago. I need to read this again.... Seems I used the __asbio__ package. – Edward Mar 27 '20 at 01:53
  • I am using library(tcltk) library(mvtnorm) library(asbio) library(multcompView) – javier J Mar 27 '20 at 04:42
  • OK - so I think I\m using the `pairw.anova` function from the __asbio__ package because you didn't mention which package you used in the question (so I guessed). Try using that package. – Edward Mar 27 '20 at 04:50