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
Related Posts with How to balance an unbalanced panel on the year variable?
Heckman Correction Rho=1 and some other issuesDear Statalisters, I have several issues and questions concerning the use of the Heckman correction…
How to plot a Kaplan-Meier Curve using multiple imputed data?Hello everyone, I am working on a project on maternal vaccination during pregnancy and acute respir…
Combing Multiple VariablesHi, I am very new to Stata, so I apologize if this a basic question or has been answered elsewhere. …
Parametric survival analysisAs a result of survival analysis, the shape of the survival function graph analyzed by Kaplan-Meier …
Oddity (?) involving placement of (missing = ) in -recode-I've discovered, I believe, that if (missing = SomeValue) is included among the assignment rules for…
Subscribe to:
Post Comments (Atom)
0 Response to How to balance an unbalanced panel on the year variable?
Post a Comment