Hi,

I am struggling to understand why I am unable to xtset my panel data.

I have used the Understanding Society Study and appended years 1991 to 2012. I am only interested in those who were part of the BHPS study (1991-2008) which can be identified via the variable pid.

For some reason I am getting the error message 'repeated time values within the panel'.

To try and solve this I have used the following commands:

sort pid year

duplicates report pid year
duplicates list pid year
duplicates tag pid year, gen(isdup)

edit if isdup
*I can see there are duplicates of people as their pid appear twice in the same year

drop isdup

**This has not solved the issue

labelbook pid

sum pid if pid==-8
*If pid=-8 this means that the person was not in the BHPS survey
*We can drop these observations as we are interested in the effect of a policy that took place before the Understanding Society Survey and the sample is large enough

drop if pid==-8
*This drops 155,484 obs

xtset pid year, yearly


What other potential solutions are there to this issue?

Thank you in advance.