Testing if distribution is similar between two groups I have a variable young that is equal to 1 if a participant is less than 25 years old. I then have a list of of each participant's favorite ice cream flavor (everyone has to choose among 25 flavors and can only make one choice). I would like to test if the distribution of tastes differs by age, using the young variable.
I have been using a ttest for each flavor, however, I am not sure this is correct. Is there a better way to test the distributions of all flavors by a dichotomous variable?
I am implementing my analysis using Stata but I am happy to receive any opinion on the matter.
 A: You would normally test for homogeneity of proportions, generally via a chi-square test, though other tests could be applied. 
This would in your case result in conducting a chi-square test on a 2x25 table.
A: You may use a goodness of fit test, i.e. chi-square test. However, you should first make sure your sample meets the following requirements:


*

*there should be at least 5 observation in each of the 25 ice-cream group (in both young and old subgroup).

*the number of observations in each subgroup should be large enough (say 100).


The test statistics follows a chi-square distribution only when your sample meets both requirements.
To calculate the test statistics, you should 


*

*select one subsample, say the young sample as the benchmark. 

*calculate the theoretical number of observations in each group of the "old" group if the distribution of flavor choice is exactly the same among two groups. (i.e. if there're 100 obs in the young group and 150 the old group, the theoretical number of obs in the old group should be 1.5 times of that in the young group.)

*the test statistics should be: $\Sigma[(theory-obs)^2/theory]$


The test statistics should follow a chi-square distribution with df of $k-1$ where $k$ is the number of groups (25) under the null hypothesis of same distribution.
I haven't use this method for a long time. So please verify it before applying.
