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.
Related Posts with Error message: Repeated time values within panel
Generate data subject to pre specified distributionHi I am new to STATA. I want to generate a random variable with integer between 0 and 4 satisfying …
weights application on chi square testHello, I have a large regional dataset with a weight variable ready. I am trying to conduct a chi-s…
Hybrid or Hausman-Taylor model with year-fixed effectsDear all, as I am analyzing the effect of education on individual's wage level with panel data on a…
Defining variables based on characters included and conditional F tests using a step down procedure (Spanning tests)Dear STATA users, I am using the code below and have encountered two problems which I could not sol…
Outcome / negative -0.000?Hello I got in a regression, for a variable the coefficient -0.0001063. The problem is that as in m…
Subscribe to:
Post Comments (Atom)
0 Response to Error message: Repeated time values within panel
Post a Comment