Hello everyone!
I am fairly new to Stata and am unable to solve (perhaps) very basic problems. I am working with a panel data for the first time, and the dataset has observations about schools, educational attainment of children with their gender, total enrolment, school localities, school types, etc.
In one of the exercises, I am required to balance my dataset on the year variable such that it has the same set of schools in every year across all the available years. Honestly speaking, I do not know what this means. After browsing through the internet for quite some time, I was only able to get this far:
xtset year
I then tried to generate a new variable from the school_name so as to balance the year variable such that it has the same set of schools every year. I did this: egen s_id = group(school_id)
But I do not know how to go on further from here. I also don't know if whatever I am doing is correct.
Could someone please help me? A very small portion of my dataset (with year and school name) looks like this:
emiscode old_emis year school_name
32120046 32120046 2004 GES BASTI AZEEM
32120046 32120046 2005 GES BASTI AZEEM
32120046 32120046 2006 GES BASTI AZEEM
32120046 . 2007 GES BASTI AZEEM
31220059 31220059 2004 GES BASTI DOCTOR MUNEER
31220059 31220059 2005 GES BASTI DOCTOR MUNEER
31220059 31220059 2006 GES BASTI DOCTOR MUNEER
31220059 . 2007 GES BASTI DOCTOR MUNEER
32110081 32110081 2004 GES BASTI FAUJA
32110081 32110081 2005 GES BASTI FAUJA
32110081 32110081 2006 GES BASTI FAUJA
32110081 . 2007 GES BASTI FAUJA
32110078 32110078 2004 GES BASTI JAM
32110078 32110078 2005 GES BASTI JAM
32110078 32110078 2006 GES BASTI JAM
32110078 . 2007 GES BASTI JAM
0 Response to How to balance an unbalanced panel on the year variable?
Post a Comment