I have a data with a continuous and two categorical (population and sex) variables. I want to test whether the means among the groups are significantly different. However, this is not an experimental design and the data is not very tidy.
The tibble below shows the number of cases in each population:sex interaction level. It is not a representation of the actual data. As stated above, actual data contains a continuous variable which is a measure of size.
# A tibble: 10 x 3
# Groups: Site [5]
Site Sex n
<fct> <fct> <int>
1 GP1 F 21
2 GP1 M 29
3 GP2 F 16
4 GP2 M 13
5 GP3 F 12
6 GP3 M 14
7 GP4 F 16
8 GP4 M 8
9 GP5 F 29
10 GP5 M 21
My question is how can I approach this kind of data?
- Should I create a new balanced dataset with equal sample sizes using the minimum number of cases in population:sex (8)?
- Or, should I create a new unbalanced dataset with equal sample sizes using the minimum number of cases in population (24)?
- Both of these mean losing a lot of data. Is there a robust test I can use with all of the data without losing any?
I should note that according to Levene test there is no heteroskedasticity but the result of shapiro test on the residuals from anova using all data is non-significant, using equal sample sizes and unbalanced data non-significant, using equal sample sizes and balanced data significant. These subsets are generated by randomly sampling without replacement from the data.