Dear Statalist,
I have a set of data. The first column is the number of different projects, the second column is the name of the project leader, the third one is the date when this project was initiated, and the fourth is the date when this project received various feedback. The same project might receive more than one comment.
I would like to screen the data and only want the rows with each leader's first project's number, name, date and feedback date. For each leader, there might be more than one row.
As an example, for leader A, I only want the first four rows and for B, I only want the sixth to eighth rows.
Looking forward to your reply and thanks a lot!
Thank,
Iris
I have a set of data. The first column is the number of different projects, the second column is the name of the project leader, the third one is the date when this project was initiated, and the fourth is the date when this project received various feedback. The same project might receive more than one comment.
I would like to screen the data and only want the rows with each leader's first project's number, name, date and feedback date. For each leader, there might be more than one row.
As an example, for leader A, I only want the first four rows and for B, I only want the sixth to eighth rows.
Looking forward to your reply and thanks a lot!
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte project str1 Name int(date1 date2) 1 "A" 22046 22046 1 "A" 22046 22046 1 "A" 22046 22046 1 "A" 22046 22047 2 "A" 22049 22049 3 "B" 20125 20125 3 "B" 20125 20126 3 "B" 20125 20127 4 "B" 20692 20692 4 "B" 20692 20693 5 "B" 20801 20801 6 "C" 21003 21003 6 "C" 21003 21003 6 "C" 21003 21004 7 "C" 21187 21187 end format %tdnn/dd/CCYY date1 format %tdnn/dd/CCYY date2
Iris
Comment