I'm using ssc install vallist
to generate a list of applicable countries that outputs a macro something like:
r(list) : "32 36 348 392 410 76 112 152 156 203"
Optionally, this can be returned separated by commas instead of spaces if it's helpful)
I then want to tab
a variable if it has a country that is anywhere in that list.
Any thoughts on how to do this. I'd like to use inlist, but I'd have to pass each country in manually like this
Typing by hand works just fine
tab health if inlist(country, 32, 36, 348,... 203)
I'd like to do this
tab health if inlist(country, r(list))
Perhaps, is there any way I can loop through each element in the list and apply a filter with a if statement?