Hello, I have a panel dataset of people and various characteristics. I want to generate a table that displays counts for each of these variables and group them by year. It's easy to do for one variable using the 'tab' function, but I cannot seem to find an option for multiple variables. For some given data (ID, Year, Sex, Age, Education), I have:
And I'd like to generate an output similar to the one below, where I'm counting the frequency of observations by year:
Is there a feasible way to do this in Stata? I can't seem to do it with the tab function. Any help would be appreciated!
ID | Year | Age | Sex | Education |
1 | 2000 | 25 | 1 | PhD |
1 | 2002 | 27 | 1 | PhD |
2 | 2000 | 20 | 0 | -- |
2 | 2001 | 21 | 0 | -- |
3 | 2000 | 23 | 1 | College |
3 | 2003 | 24 | 1 | College |
Sex | Age | Education | |
2000 | 3 | 3 | 2 |
2001 | 1 | 1 | 0 |
2002 | 1 | 1 | 1 |
2003 | 1 | 1 | 1 |
Is there a feasible way to do this in Stata? I can't seem to do it with the tab function. Any help would be appreciated!
Comment