Assume I have a dataset with the variables year1, year2, ..., year19, year20.
forval i = 1/20 {
gen year`i' = 1
}
The command -aorder- sorts the variables in ascending order of the
number that follows "year". The technical note in [D] order explains
that this is by design, "even though to most computer programs, year10
is alphabetically between year1 and year2."
There are cases where I would like the variables to be sorted in
strict alphabetical order, like this:
year1
year10
...
year19
year2
year20
year3
...
year9
Any suggestions on how this can be done without specifying the sort
order with -order-? It would be nice to have an option like -aorder,
strict- that does not try to be as smart as the current version of
-aorder-.
Thanks,
Friedrich
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/