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
How to use marker symbols with twoway graphDear Statalists, I have two questions that I am sure are relatively easy for you. First: I am plott…
How to make a new variable from a group of variables answered on a rickert scaleHi All, I am using a firm-level data set and I have 11 questions relating to the obstacles to innov…
Advice on observational study data analysisHello everyone, I am doing a fairly large population study to estimate the treatment effect of a dr…
Using -xtile- to assess the impact of a variable on an outcomeHi All, I am looking to understand at what number of kids or distribution does a household member g…
Error while using _N in forvalues loopI want to use _N in place of the total count of observations in a loop like this: forvalues i = 1(1…
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