-
Login or Register
- Log in with
clear input str3 contributor float(receiver date) "A" 1 2000 "B" 2 2000 "C" 3 2000 end fillin contributor date receiver g check=cond(!_fillin, "Y", "N")
. sort contributor _fillin
. l, sepby(cont)
+----------------------------------------------+
| contri~r receiver date _fillin check |
|----------------------------------------------|
1. | A 1 2000 0 Y |
2. | A 2 2000 1 N |
3. | A 3 2000 1 N |
|----------------------------------------------|
4. | B 2 2000 0 Y |
5. | B 3 2000 1 N |
6. | B 1 2000 1 N |
|----------------------------------------------|
7. | C 3 2000 0 Y |
8. | C 2 2000 1 N |
9. | C 1 2000 1 N |
+----------------------------------------------+
clear input str3 contributor float(receiver date) "A" 1 2000 "B" 2 2000 "C" 3 2000 end fillin contributor date receiver g check=cond(!_fillin, "Y", "N")
. sort contributor _fillin . l, sepby(cont) +----------------------------------------------+ | contri~r receiver date _fillin check | |----------------------------------------------| 1. | A 1 2000 0 Y | 2. | A 2 2000 1 N | 3. | A 3 2000 1 N | |----------------------------------------------| 4. | B 2 2000 0 Y | 5. | B 3 2000 1 N | 6. | B 1 2000 1 N | |----------------------------------------------| 7. | C 3 2000 0 Y | 8. | C 2 2000 1 N | 9. | C 1 2000 1 N | +----------------------------------------------+
| contributor | receiver | date |
| A | 1 | 2000 |
| B | 2 | 2001 |
| C | 3 | 2002 |
| contributor | receiver | date | check |
| A | 1 | 2000 | Y |
| B | 1 | 2000 | N |
| C | 1 | 2000 | N |
| B | 2 | 2001 | Y |
| A | 2 | 2001 | N |
| C | 2 | 2001 | N |
| C | 3 | 2002 | Y |
| B | 3 | 2002 | N |
| A | 3 | 2002 | N |
* Example generated by -dataex-. For more info, type help dataex clear input str1 contributor byte receiver int date "A" 1 2000 "B" 2 2001 "C" 3 2002 end fillin receiver contributor bys receiver(date): replace date= date[1] g check= cond(!_fillin, "Y", "N")
. l, sepby(date)
+----------------------------------------------+
| contri~r receiver date _fillin check |
|----------------------------------------------|
1. | A 1 2000 0 Y |
2. | C 1 2000 1 N |
3. | B 1 2000 1 N |
|----------------------------------------------|
4. | B 2 2001 0 Y |
5. | A 2 2001 1 N |
6. | C 2 2001 1 N |
|----------------------------------------------|
7. | C 3 2002 0 Y |
8. | A 3 2002 1 N |
9. | B 3 2002 1 N |
+----------------------------------------------+
Comment