Hi all, I have a simple question. Say I want to process filenames or variable names with consecutive numbers such like "abc1xyz", "abc2xyz", "abc3xyz", "abc4xyz", ... , "abc100xyz", so I need to generate a local list of these names. Directly using local list "abc1xyz......" makes the code be too long if there are too many consecutive numbers, so I would like to ask if there is any simple way to generate local list with consecutive numbers like this? Many thanks in advance!
PS: I know that if I want to do loop. I can use forvalues x=1/100 and if I want to keep or drop variables I can use keep abc*xyz. But still, sometimes I need the list, for example when I need to keep variables with odd numbers in this list "abc1xyz", "abc2xyz", "abc3xyz", "abc4xyz", ... , "abc100xyz".
Related Posts with How to generate a local list with numbers in a simple way
Using "lincom" after "margins"Hello. I have a question with respect to using the lincom command after the margins command. Specif…
Deflate wages with deflator from different fileHello, I need to deflate my wages with a consumer price index which I have in a different file. How…
-domin- (SSC): computing time /max. number of independent variablesHi everybody, I am using Stata 16.0 and I am trying to perform dominance analysis using the -domin-…
Problems with stset on long dataHi, I'm trying to stset survival data in long format. I used reshape to convert from wide to long: …
Panel Data - treatment*for group data based on within group characteristicsHello, I am interested in assigning a treatment to a firm if it was domestic (foreign=0) in year 20…
Subscribe to:
Post Comments (Atom)
0 Response to How to generate a local list with numbers in a simple way
Post a Comment