5
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ What were you comparing with your t-test -- the counts? $\endgroup$
    – Glen_b
    Commented Mar 9, 2015 at 4:55
  • $\begingroup$ If you are doing 25 test for 1 phenomenon you are going to have a multiple comparisons problem. Even if your null hypothesis of no difference is true you should expect significant results unless you take this into account. $\endgroup$
    – kasterma
    Commented Mar 9, 2015 at 5:36

2 Answers 2

1
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ thanks, this makes sense. Do you have any idea how to implement this in a statistical package such as Stata? $\endgroup$
    – LF12
    Commented Mar 9, 2015 at 16:43
  • $\begingroup$ Sure, it's a standard chi-square test (the test for homogeneity of proportion and the test for independence are the same). I don't have access to Stata, but I can show an example in R. $\endgroup$
    – Glen_b
    Commented Mar 10, 2015 at 1:11
0
$\begingroup$

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:

  1. there should be at least 5 observation in each of the 25 ice-cream group (in both young and old subgroup).
  2. 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

  1. select one subsample, say the young sample as the benchmark.
  2. 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.)
  3. 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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.