Dont forget to be happy?


Fast and easy

How to prepare panel data in stata 

Thanks for stoping by here. If you want to follow step by step in how to prepare panel data in stata. Please follow the command below.

Before we start, couple things that you have to do is

  1. Prepare the list of group of your sample, it can be country, company, whatever. 
  2. Prepare the list of time, it has to be repetitive, could be month in a year, could be year specifically. 
  3. And then make sure if you create it in godd structure. 
  4. If you need any info or video how to create it. Feel free to write in comment below. 

// To re group into numeric the variable parameter

egen (proposed variable) = group(the existing variable as a parameter) 

in this example

egen countrynum = group(A) 

// To check whether the data is fit with the

countrynum list A 
countrynum in 1/10, sepby (A) 

// To prepare based on the group of parameter

xtset (variable of group) 
xtset countrynum 

// To set the group yearly

xtset countrynum (the yearly variable), yearly xtset countrynum B, yearly 

// to regres this panel data

xtreg (dependent variable) (independet variable and the rest)

Panel data stata

Current rating: 5


Load More