Hello, all Statalists!
I run a long do file and I want to create a table (on excel or word) that documents all the deletions in the process.
Here is a subset of the dataset:
In addition, these are two drop commands I use:
In this case, the table looks like this:
Again, the do file I use contains of many drop/keep commands. Thus, I am looking for a solution that creates this long table automatically.
Many Thanks!
I run a long do file and I want to create a table (on excel or word) that documents all the deletions in the process.
Here is a subset of the dataset:
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input long id byte(var2 var1)
1 10 5
1 11 5
1 11 5
1 11 5
4 11 5
4 11 5
4 11 5
4 11 5
8 11 5
8 11 5
8 11 5
8 11 5
9 12 5
9 12 5
9 12 5
9 12 5
101 9 5
101 10 5
101 10 5
31766 9 8
31766 9 8
31766 9 8
end
In addition, these are two drop commands I use:
Code:
keep if var1==5 drop if var2>12 | var2<10
| Step | Command | Observations Deleted | IDs Deleted | Observations | IDs |
| 0 | 22 | 6 | |||
| 1 | keep if var1==5 | 3 | 1 | 19 | 5 |
| 2 | drop if var2>12 | var2<10 | 1 | 0 | 18 | 5 |
Again, the do file I use contains of many drop/keep commands. Thus, I am looking for a solution that creates this long table automatically.
Many Thanks!

Comment