Using Panel Data in Stata

by Irina 9. February 2008 11:27
A panel dataset should have data on n cases, over t time periods, for a total of n × t observations. Data like this is said to be in long form. In some cases your data may come in what is called the wide form, with only one observation per case and variables for each different value at each different time period. To analyze data like this in Stata using commands for panel data analysis, you need to first convert it to long form. This can be done using Stata's reshape command
reshape long EXPOSURE, i(GROUP) j(year)  
(note:  j = 2000 2001 2002)

Data                               wide   ->   long
-----------------------------------------------------------------------------
Number of obs.                        200 ->       600
Number of variables                   4   ->       3
j variable (3 values)                     ->   year
xij variables:
 EXPOSURE2000 EXPOSURE2001 EXPOSURE2002 ->       EXPOSURE---------------------

long tells reshape that we want to go from wide to long

EXPOSURE tells Stata that the stem of the variable to be converted from wide to long is EXPOSURE

i(GROUP) option tells reshape that GROUP is the unique identifier for records in their wide format

j(year) tells reshape that the suffix of faminc (i.e., 2000 2001 2002) should be placed in a variable called year

The reshape wide command puts the data back into wide format

Related posts

Comments

11/6/2010 2:13:06 AM

I'm rather new in path from the net and vital to scan up on this subject matter. Thought to be it was a excellent doc somewhat appropriately written and valuable. I'm heading to absolutely be coming as rapidly as once a lot more for your net webpage to search considerably considerably a lot a lot more posts as i adored this an individual.

Nike Shox Deliver

11/25/2010 3:59:32 AM

Thank you for one more nice article. The place else may anybody get that kind of information in such an ideal approach of presentation.

nike shox

1/13/2011 3:58:47 AM

I suggest this site to my friends so it could be useful & informative for them also. Great effort.

valentine day flower delivery Netherlands

4/12/2011 9:57:23 PM


Your article is really great and I truly enjoyed reading it, keep walking

sending flowers to switzerland

4/23/2011 2:08:42 AM

just like before, i know, i will gain more knowledge when i entry into you website.

True Religion Jeans Outlet

4/24/2011 8:54:49 PM

very nice post.

cheap iphones

8/7/2011 10:03:52 PM

Pretty good post. I would like to thank you for sharing your thoughts and time into the stuff you post!

<a href="Pretty good post. I would like to thank you for sharing your thoughts and time into the stuff you post!

<a href="http://www.casino-giochi.com/giochi-di-casino.html">gioco casino</a>-di-casino.html">gioco casino</a>

gioco casino

8/7/2011 10:04:11 PM

Pretty good post. I would like to thank you for sharing your thoughts and time into the stuff you post!

<a href="Pretty good post. I would like to thank you for sharing your thoughts and time into the stuff you post!

<a href="http://www.casino-giochi.com/giochi-di-casino.html">gioco casino</a>-di-casino.html">gioco casino</a>

gioco casino

Add comment


(will show your Gravatar icon)  





Live preview

2/5/2012 9:05:50 PM

 

About the author

Irina Spivak Irina Spivak
Team Leader at G-Stat. More...


Send mail Email

Blogroll

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2012

    Sign in

    eXTReMe Tracker