# What is the minimum size a category/group should have for unbiased predictions? skewed distributions

I am trying to find out if there is a correlation between a specific category and age. For example:

if being a vegetarian has any relationship with age.

The purpose is to use this information to make predictions about age on a test data.

So far it looks like a null-hypothesis question and my first attempt is to apply one of the test statistic formulas in this page. As the standard deviation of the dataset and size of each category can be calculated I am inclined to one-sample z-test .

The thing is I am not sure if the z-test can be applied to skewed distributions. The distribution is given below. Can z-test be applied to it? If yes do I need any modifications on the formula? If no, why?

This dataset consists of ~10000 rows. The mean (age) is 32, the median is 30 and the mode is at 26.

What I do is to calculate the mean age for each category, compare it with the dataset's mean and decide if the category should be taken into consideration or not while estimating the age. Empirically, if the average age of a category is within 5% of the dataset's mean I ignore that category. I don't have much scientific proof for choosing 5%. Do you think it is valid?

During calculations I noticed that sample size for some categories can be quite low compared to 10000. Assuming there was a category of "meaterian" with 35 members and mean age 23, this category would be a gem for predictions (as the local mean deviates greatly from the dataset's) only if the sample size was not too low to be trustworthy. If I get it right, for normal distributions, categories with size of 30+ can be taken into consideration. But in this case, the distribution is skewed and it looks like threshold of 30 cannot be applied anymore.

So, for skewed distributions, what is the appropriate method to find out the minimum size a category should have so that it can be taken into account while making predictions?

Thank you.