Hi
I am trying to create a table showing the distribution of age of first marriage across many different ethnic groups (i.e. to see where the most common ages are for each ethnicity) but am getting "too many values" when I try to run my code (I have around 200 different ethnic groups). This originally worked when I ran the code by each country when I had separate ethnicity variables for each country, but now I have had to combine them into 1 ethnicity variable and compare them this way.

My code I am trying to use is as follows:
Code:
tab agefrstmar ethnicityall if yrgroup == 0, column nofreq
The only way I have figured out how I could get the results I wanted was for each ethnic group to do as follows, but this could be quite long so was wondering if there's a shortcut before I do this:
Code:
tab agefrstmar ethnicityall if yrgroup == 0 & ethnicity == "Acholi"
etc

I tried using a foreach command but this also said there were too many values
Code:
foreach ethnicity in ethnicityall { 
    tab agefrstmar `ethnicity' if yrgroup == 0 
}