|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Computing GDP growth using a log-linear regression
Dear All,
I was wondering if anyone knew how to compute GDP growth rates by
country. I have panel data arranged as follows:
Country Year GDP ($ 2000)
Benin 1997 1947193088
Benin 1998 2035610240
Benin 1999 2131227520
Benin 2000 2254838784
Benin 2001 2367580672
Benin 2002 2474121728
Benin 2003 2570612480
Benin 2004 2650301440
Benin 2005 2727160320
.
.
.
And so on for a number of countries. Arranged by country code and by year.
I found an example in the archives of how to calculate the growth
rates (http://www.stata.com/statalist/archive/2006-05/msg00529.html)
and yet when I try to do the same I get an error message 'Type
mismatch', no matter which variable type I enter. I typed the
following into the command box and came out with the output shown.
. egen minyearbycountry = min(year), by(code)
r; t=0.00 15:30:23
. gen yearcounter = year-minyearbycountry
r; t=0.01 15:30:31
. gen g = .
(288 missing values generated)
r; t=0.00 15:30:39
. levelsof code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
27 28 29 30 31 32
r; t=0.01 15:30:48
. foreach var in `r(levels)' {
2. reg lnGDP yearcounter if code =="`var'"
3. replace g = _b[yearcounter] if code =="`var'"
4. }
type mismatch
r(109); t=26.93 15:31:23
I would be grateful if anyone could point out where I have gone wrong?
Regards,
Dave
*
* 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/