Hi all,
I have a panel data set where I want to conditionally delete observations. In my case, I am studying funds. I want to delete all funds that have even one observation of Total Net Assets (TNA) under 5 million. This means I want to delete all the observations of the fund at once and not just the observations of the fund that have a "TNA" under 5. Below I've written down an example to clarify what I mean.
What is currently happening is that when I try to delete fund 1 with the commands below, only observations 1 and 2 will be deleted of fund 1. However, I aim to delete the whole of fund 1 at once.
Commands used:
xtset fund date
by fund (date), sort: drop if tna < 5
Example:
Fund: Date: TNA:
1 01/01 4
1 01/02 4
1 01/03 6
1 01/04 6
2 01/01 20
2 etc. 20
2 20
2 20
Thank you in advance.
Related Posts with How to delete observations in panel data
Delete all values for 1 company if some observations are missing.Hi everyone, Do you know the code to delete the entire board if 1 value is missing? For example, th…
Sample may not include multiple panels error after trying to perform Breusch Godfrey test forDear Everyone, I am using panel data and I want to test for autocorrelation in my dataset. The data…
Draw Random Sample Based on Iterative AlgorithmDear Statalisters, I have a panel data set with roughly 700 observations. Participants were require…
Creating a new variable which are label values of other variableDear Statalist , I have a data of food item that people eat. The data stored as numeric and labelle…
Hold the Time for Fix Effect (monthly)Hello everyone, I am currently sitting on an understanding issue. I want to hold my regression for …
Subscribe to:
Post Comments (Atom)
0 Response to How to delete observations in panel data
Post a Comment