Dear stata users, per year quarter I've information on origin and destination for the airlines in the US. I want to generate a new variable (frequency) that counts the number of destinations from (for example ATL) from a specific airline per quarter of the year.
I was thinking about using the egen command or collapse and than merge both datasets.
Create number of destinations from the airports
egen numdest = group(dest)
or:
collapse numdest, by(origin year quarter)
merge one to one
It looks like this: T100 domestic data
I was thinking about using the egen command or collapse and than merge both datasets.
Create number of destinations from the airports
egen numdest = group(dest)
or:
collapse numdest, by(origin year quarter)
merge one to one
It looks like this: T100 domestic data
Year | Quarter | Origin | Dest | Airline |
2005 | Q1 | ATL | DWT | Delta |
2007 | Q2 | ATL | MEM | Continental |
Comment