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)?