0

I know that many have asked the exact same thing, but nothing solved it for me...

I want to compare the size of a morphological structure between two age groups (which I call BW and brownish), I'm sure I only have these two categories and there are no empty cells or NAs

But every time I try it appears that I have more than 2 levels

I can't use the levels function either, it returns null, str(dd1) returns male_color is a Character Datatype and the Right_tarsus is a number Datatype data, as the spected

the morphological data also worked well in the ggdensity and shapiro.test to test normality,

MU_test_color_tarsus <- wilcox.test(Right_tarsus ~ male_color, data = dd1, paired = F, conf.level = 0.95) 
wilcox.test(Right_tarsus ~ male_color, data = dd1, paired = F, conf.level = 0.95)
neilfws
  • 32,751
  • 5
  • 50
  • 63
  • 3
    Without the data or even a sample of it, it is difficult to know what the problem is. What do `table(dd1$Right_tarsus)` and `table(dd1$male_color)` look like? It may be that there are some misspelled values in your data. – dcarlson Apr 26 '22 at 03:13
  • The error doesn't say that you have *more than* 2 levels, just that 2 levels are required. If `male_color` is of type character then it has no levels - it needs to be of type factor. Perhaps try `dd1$male_color <- as.factor(dd1$male_color)` then run the test again ? But really we need to [see your data](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) by including a small representative dataset in a plain text format - for example the output from `dput(dd1)`, if that is not too large. – neilfws Apr 26 '22 at 03:15
  • I understand that without the data it is difficult But to be honest, I don't know how to make them available here.... Is there any way I can make an excel spreadsheet available here? – Tarso Ciolete Apr 27 '22 at 17:11

0 Answers0