R statistical test for two groups with categorial data

I have two groups, in which three possible outcomes appeared at different frequencies, and I wanna know, if there is a significant difference in-between the groups.

For instance, I have two potatoe fields, field A and field B. The potatoes grew either tall, normal, or small in the respected fields e.g.:

    Amount of potatoes
Tall  -   Normal  -  Small
A:   30         10       2
B:   48         12       1


"71% percent of the potatoes on field A grew tall." Is this significantly different to on field B?

Was looking for some Anova test but couldn't find a suitable. Also most were looking for numeric data with mean values etc.

• A chi square test is probably what you are looking for. This is a better question for the cross validate site. Commented Apr 29, 2022 at 22:57
• Thanks Dave! Chi square looks good. But it is only usable for two variables, is that correct? Commented Apr 29, 2022 at 23:23
• Your example only has two variables. The loglin() function provides a way to handle multidimensional tables. Also a possibility is Poisson regression using glm(). Commented Apr 30, 2022 at 3:57
• $\chi^2$ is good for any number of variables. I also like the $G-test$, which is a likelihood ratio test of nested (multinomial) logistic regression models. I show that here, and you can apply my code to nested multinomial logistic regression models, since you have a $3$-category $y$.
– Dave
Commented Apr 30, 2022 at 9:28