Sample size of the levels of a categorical variables Is there a generally acceptable sample size for the levels of a categorical variable included in a regression analysis? For example, if we have a variable color with 3 levels:


*

*5 reds

*140 blues

*155 greens


Could our regression coefficients be biased when comparing, say reds to blues? Or would it be better to discard all records for red (or when applicable, re-code the variable)?
 A: While not ideal (you would prefer indeed a more balanced color variable) it is not catastrophic. It would be more of a problem if your response variable was quite unbalanced (say 5 positives vs. 295 negatives). You might want to consider Firth regression (essentially a penalized logistic regression variant - see the function logistf from the package with the same name), if you suspect you might have complete separation within your dataset and/or you get nonsensically large standard errors (Wald estimates of standard error are commonly the first thing that fails in such situations). Yes, if it makes sense to recode your variables so there are no red levels; that would be ideal but I would suggest that only if it is reasonable and not just a trick to sweep some cumbersome observations under the rug.
(You do not mention convergence issues, so I assume you model can be estimated successfully.)
A: If I'm understanding your question correctly, not really. Sample size refers to the data points you have drawn from a broader population, while the number of data points in a given category is a count of observed properties of the sample. Some statistical tests perform poorly with too few observations for a category, but that is a function of the test itself and not the population or the sample.
If the broader population happened to have the same ratios of colors as your sample (5 red : 140 blue : 155 green) then your sample perfectly represents the population and there is no bias. Conversely, your sample could absolutely be biased-- there is no way to tell just from the counts without pointing to some outside information explaining why you think the counts are suspicious. Do you have some reason to think that the population has more reds than your sample suggests, or are you just suspicious of the count for reds because there are so few relative to blues and greens (which are similar to each other)?
If your sampling was random and you do not believe that the red count is a result of measurement error then I would not recommend deleting or recoding the data points for red. Tampering with your data needs a far better reason than "it looked weird and was awkward to work with".
