Hi all, I just a beginner using STATA and I need an help to solve a problem that probably seems simple to experts. I have a long data file that describes flight routes covered by different air carriers and I need to calculate the number of routes operated by more than one air carrer. To achieve this result I generate two dummy variables: the first one indentifies the same route and the second one indicates 0 when it is covered by a single carrier and 1 if the same route is covered by more than one carrier. Here a short example:
+------------------------------------------------------+
| F_Route AirCode No_Differ SameRoute |
|-------------------------------------------------------|
| ABQ-ATL DL 1 0 |
| ABQ-AUS G4 2 1 |
| ABQ-AUS WN 2 1 |
| ABQ-AUS WN 2 1 |
| ABQ-BNA WN 3 0 |
| ABQ-DEN UA 4 1 |
| ABQ-DEN WN 4 1 |
| ABQ-DEN AA 4 1 |
| ABQ-DEN UA 4 1 |
+------------------------------------------------------+
I am not able to find a STATA command able to count the number of F_Route by the SameRoute (in this sample the result is 2 because only ABQ-AUS and ABQ-DEN are covered by more than one air carrier).
Please do you have any suggestions to fixed this problem ? Thank you in advance for your help.
Giancarlo
Related Posts with How to count the number of the multiple observations into the same group once
Problem with using "Split code"Hello, This is my first time posting here so pardon me if my post didn't follow the forum format. I…
mi estimate sequencingIf I want to use multiple imputation, it seems like this is the first step: Code: mi set mlong mi …
Combine Box PlotsI am conducting a study on climate vulnerability using an index as my proxy for vulnerability. In co…
Why homogeneous treatment assumption leads to "spurious identification of long-run treatment" in staggered DiD?Borusyak, 2021 has a sentence Third, in dynamic specifications, implicit assumptions about trea…
F testHi everyone, I have a simple question, what is the difference between the F-test that we find in the…
Subscribe to:
Post Comments (Atom)
0 Response to How to count the number of the multiple observations into the same group once
Post a Comment