Hi,
I have the variables: xyz1983 xyz1984 xyz1986 ...xyz2016 (not all years, some are missing)
now I need to create a loop that loops over the years in my list starting from 2016 to the earliest.
I manage to save the years from the variable name in a local list, but only in ascending order, how can I reverse the order or solve this otherwise?
[qui d xyz*, varlist
local wlist = r(varlist)
local wlist: subinstr local wlist "xyz" "", all
]
I have the variables: xyz1983 xyz1984 xyz1986 ...xyz2016 (not all years, some are missing)
now I need to create a loop that loops over the years in my list starting from 2016 to the earliest.
I manage to save the years from the variable name in a local list, but only in ascending order, how can I reverse the order or solve this otherwise?
[qui d xyz*, varlist
local wlist = r(varlist)
local wlist: subinstr local wlist "xyz" "", all
]
Comment