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
Syntax error in estoutI am producing tables using estout but even though the code creates a row for them, it won't produce…
SortI think this is a simple question. I have a categorical variable (85 departments) in a long data set…
Pr-testHello I hope you can help me with something to my bachelor thesis. I want to make a pr test to compa…
Collinearity in DID modelDear friends, I met the collinearity problem in DID model. I selected the sample who did not enter …
IV with dummy variableDear all, I am trying to run this model: Array Where i is individual i, in strata s, and time t. …
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