ID-number in Stata


New Member
Dear you,

I might have a stupid question, but I have not found the answer on google, and I hope someone can help.

I have a dataset where there are several observations for each ID-number, and I do not know how to tell Stata that these observations should be linked.

For example I have:

Id=1 Income(year one)
Id=2 Income (year one)
Id=1 Income (year two)

So, I want Stata to read my data as: Id=1, income year1...n

So, my problem is that I do not know how to tell stata that it should group all the observations for Id=1, and all the observations for Id=2..

How do I do that?

Please help? :)


TS Contributor
Sounds like you have panel data. You could look here for all the possibilities in that area. The exact solution thus depends on what exactly you want to do with that data. It may very well be that you need to do nothing or using xtset or do something else.