Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: growth rate in panel data


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: growth rate in panel data
Date   Thu, 10 Feb 2011 14:46:16 +0000 (GMT)

--- On Thu, 10/2/11, Humaira Asad wrote:
> I have a 5 yearly panel data set covering 107 countries. I
> have to calculate the growth rate of different variables.
<snip>
> I want to calculate the growth rate of log of GINI for
> 1965, 1970 etc for each country. The years are 1965, 1970
> ..... to 2010.

You obviously need two consecutive observations to know the 
change, so using your example data, there will only be one
observation for which you can compute the growth (1975 for 
country  A). For all other observations in your dataset we 
just do not know what the growth is, and Stata will corectly 
give them a missing value. 

*------------- begin example --------------
// create the dataset
clear
input str1 country  year  loggini
           A         1965  .
           A         1970  3.68
           A         1975  2.34
           A         1980  .
           B         1965  .
           B         1970  3.24
end

// country needs to be numeric
encode country , gen(countrynum)

// declare the data as time series
// -delta(5)- tells Stata that it 
// is a 5-yearly panel
tsset countrynum year, delta(5)

// create growth
gen growth = D.loggini 

// look at the results
list
*------------ end example ---------------
(For more on examples I sent to the Statalist see: 
http://www.maartenbuis.nl/example_faq )

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index