Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Panel data manipulation question


From   "Nick Winter" <nwinter@policystudies.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Panel data manipulation question
Date   Mon, 15 Jul 2002 16:13:00 -0400

Appending the data for that year is pretty easy:

	. save mydata
	. keep if country==72
	. keep year p
	. rename p p72
	. sort year
	. save country72
	. use mydata
	. sort year
	. merge year using country72
	. tabulate year _merge
	. erase country72.dta

That last just checks that all years in your database were matched.

--Nick Winter


-----------------------------------------------------------
 Nicholas Winter, Ph.D.                     P 202.939.5343
 Policy Studies Associates                  F 202.939.5732
 1718 Connecticut Avenue, NW     nwinter@policystudies.com
 Washington, DC 20009-1148           www.policystudies.com
----------------------------------------------------------- 

> -----Original Message-----
> From: Brooks Taggert J [mailto:brooks.tagg@uwlax.edu] 
> Sent: Monday, July 15, 2002 4:08 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Panel data manipulation question
> 
> 
> Statlisters-
> 
> I can't seem to figure out how to do this easily, although 
> I'm quite sure it must be possible.  I have a panel data set 
> on individual countries and I want to create a new variable.  
> The variable is going to be the ratio of a variable I already 
> have in my dataset, we'll call it P.  I want to create a 
> variable we'll call X where x=p/p(i==72).  That is to say I 
> want to deflate all the values of p, by the value of p for 
> country 72, for the corresponding year.  I thought about 
> trying to grab the time series for that specific country and 
> appending it to every other country, but that seems awkward.  
> I've thought about reshaping the data, but that seems tedious 
> as well.  Any suggestions are always appreciated.  
> 
> 
> Thanks.
> 
> TJ
> 
> 
> Taggert J. Brooks, PhD
> Assistant Professor of Economics
> Department of Economics
> University of Wisconsin - La Crosse
> 403O North Hall
> 1735 State Street
> La Crosse, WI 54601 
> Phone: (608) 785-5295
> Fax: (608) 785-8549
> Email: brooks.tagg@uwlax.edu 
> "At the age of six I wanted to be a cook. At seven I wanted 
> to be Napoleon. And my ambition has been growing steadily 
> ever since." 
> -Salvador Dali
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index