0
votes

I implement dynamic panel data models, by using xtivreg, xtabond. In the sample I have 305 groups:

.xtsum id
+--------------+
| Observations |
+--------------+
| N=13588      |
| n=305        | 
| T-bar=44.5508|
+--------------+

The Stata uses only 292 groups from my sample for xtabond

Number of obs=11636
Number of groups=292

And for xtivreg it uses only 213 groups

Number of obs=8199
Number of groups =213

Please, could you give any suggestions how can I know which group id Stata use for estimation, is there are any post estimation command that can ask Stata to print out list of group_id which it used for a particular model? To compare the results I have to use exactly the same sample.

1

1 Answers

3
votes

After an estimation command Stata leaves behind e(sample), which is 1 when an observation was used and 0 when an observation was not used. If you estimate another model then e(sample) is overwritten, so if you want to keep that information, you need to store it in a variable, something like this gen byte used_model1 = e(sample). If you want a list of all ids used, you can type something like tab id if used_model1==1