Dear Statalist users,
I am using Stata 17. I have unbalanced panel data with obs ranging from 1 to 300+ for N (cross-section). The data looks the following:
id month price
1 1 100
1 2 110
2 1 110
3 1 200
3 2 100
3 3 300
.........................
I want to drop ids with the number of obs < 50. I can do this manually like drop if id == 2 | id == 20 | and so on. How can I automate it as I have a large number of ids (N)?
Related Posts with Droping id with insufficient obs
Can xtabond2/xtdpdgmm be applied to estimate a static (rather than dynamic) panel data model?Dear All, The (ssc install) xtabond2 and (ssc install) xtdpdgmm commands are commonly used to estima…
merging datasetsI am trying to merge two datasets, which have the date variable in common. However, when I try to me…
Combine different tabstat results in oneCan I substitute count of the number of observations with the count of unique "conm" which stands fo…
Counting number of occurrence of observations based on two variablesDear community, I have a dataset; the following code generates a snippet of it Code: clear input …
Drop observations given multiple conditionsHi everyone, I am working on a state dataset where I need to keep observations of firms with non-mi…
Subscribe to:
Post Comments (Atom)
0 Response to Droping id with insufficient obs
Post a Comment