I manage a longitudinal dataset of schools shaped wide, so there is one row per school and variables about each school spanning multiple years. Stakeholders often need a table displaying a subset of schools and variables from our 1,000+ variable file. For example, our marketing team wants to be updated regularly when a school closes. I would prepare an Excel spreadsheet with all the recently closed schools and relevant variables for the marketing team.
I was able to pull this information fine with Stata 14 using a simple browse command. My code with Stata 14 would look like this:
browse school AccountID county enrollment ClosedDate GradesServed website if statustype=="closed" & year(ClosedDate)==2024
The variables would be listed in the order of my code. Stata 17 lists the variables in their order within the dataset. I need the variables to be listed in the order they are called within the browse command.
I know the order command and could reorder the variables. But I often have to pull multiple lists and save other changes into our records in the same working session. The variable lists are so long that ordering and reordering them would take a long time.
Is there an easy way to browse or export a list of variables in a specific order using Stata 17?
Interesting, I tried the following snippet and Stata 17 behaviour is the same as expected:
This opens the editor with the varlist as specified in the command, not as ordered in the original dataset.
It would be helpful if you can check that the same behaviour persists when using the small snippet above.