In a panel dataset, there are companies with revenues for multiple years.
I would like to drop all companies if their revenue information is missing for any year.
Is there a simple way to achieve this?
In SQL, I would do something like:
I would like to drop all companies if their revenue information is missing for any year.
Is there a simple way to achieve this?
In SQL, I would do something like:
Code:
DELETE FROM table WHERE company_id IN (SELECT DISTINCT company_id WHERE sales(t)=0 AND sales(t-1)>0)
Comment