Hello, I'm new to stata and am recreating code that I originally wrote in MatLab. It's for a weekly report type of document based on a user database where I want to see the (for example 10) most common countries where our users live. Right now I'm just tabulating the whole list of countries, like so:
Also ideally I'd want them sorted by number of people from each country, rather than alphabetically. How would I go about this?
In my old code I made a 2 column array with nr of users in one and country name in the other, ran a sorting algorithm and deleted everything not in the top 10, then just paste to excel.
But MatLab can handle limetless number of arrays at the same time while Stata seems to want only one open at a time?
Thanks in advance
Code:
tab2xl(country) using STATAtest_report.xlsx, col(11) row(2)
In my old code I made a 2 column array with nr of users in one and country name in the other, ran a sorting algorithm and deleted everything not in the top 10, then just paste to excel.
But MatLab can handle limetless number of arrays at the same time while Stata seems to want only one open at a time?
Thanks in advance
Comment