There is a dataset with 3 variables - ID, Wage and Year, it is an unbalanced panel.There are 2 problems:
- I want to drop all data on such IDs for which there is a Year with no observations. Shortly, i want to convert my unbalanced panel into balanced dropping every id that creates this "unbalanceness".
For example, if a guy with ID = 1 didn't report his Wage in a Year = 2010 (and therefore there is no observation with Year = 2010 and ID = 1), I want to drop all data for ID = 1.
It seems like a popular question, but all I found on Google and StackOverflow were multiple solutions for Stata and none for SPSS.
UPDATE: I managed to solve this problem using COUNTIF Excel function. I created a variabe that counted amount of times certain ID appeared in dataset and kept obseravtions for which this function=amount of years, thus dropping unbalanced IDs. However, i'm still in dire need of solution to the second problem :)
- Second question is almost the same as the first one - I want to drop all data on such IDs for which there is a Year when they reported Wage = 0
For example, if a guy with ID = 1 reported Wage = 0 in a Year = 2010, I want to drop all data for ID = 1.
If there is a filling command in SPSS that balances unbalanced panel with missing values, it seems like solution to second problem is a solution to the first one at the same time.
UPDATE 2: I solved this problem as well using COUNTIFS on Wage and ID. Excel is omnipotent, praise Excel.