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
Generating a dummy variable if a household has a migrant or not.I have household survey on data including variables 'HouseholdID' containing an ID number unique to…
Bug in Mata's st_view() function with time-series operators?I experienced an unexpected behavior of Mata's st_view() function. In the following, I want to obtai…
How to handle 3-dimensional ("panel") data?Hi, I have a dataset of individual daily investor trading data. In total, there are about 1 million…
Do logs modify the correlation between two variables?Dear Statalists, I am applying logs to two variables: Code: gen In_Arg_X_Bra=ln(Arg_X_Bra+1) gen…
Bug in estout when using same estimate in two columnsIf the same estimate is shown in two separate columns, using the -indicate- option, only one column …
Subscribe to:
Post Comments (Atom)
0 Response to Droping id with insufficient obs
Post a Comment