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]

st: aggregation


From   Abu Camara <[email protected]>
To   [email protected]
Subject   st: aggregation
Date   Tue, 19 Jun 2012 10:19:59 +0300

Dear Statalist,

I am doing some aggregation (total) for the BRICS countries. I am
having different results
with Stata if I use Excel. I did it manually and I get exactly the
same result as Excel.
What wrong am I doing with Stata?

Here is the sample data and code:

year	gdp_growth	country	weight
2005	3.2	Brazil	2.79
2006	4.0	Brazil	2.759
2007	6.1	Brazil	2.781
2008	5.2	Brazil	2.85
2009	-0.3	Brazil	2.866
2010	7.5	Brazil	2.931
2011	2.7	Brazil	2.908
2005	6.4	Russia	2.987
2006	8.2	Russia	3.073
2007	8.5	Russia	3.169
2008	5.2	Russia	3.25
2009	-7.8	Russia	3.024
2010	4.3	Russia	2.999
2011	4.3	Russia	3.021
2005	9.0	India	4.281
2006	9.5	India	4.46
2007	10.0	India	4.661
2008	6.2	India	4.822
2009	6.6	India	5.186
2010	10.6	India	5.455
2011	7.2	India	5.65
2005	11.3	China	9.445
2006	12.7	China	10.123
2007	14.2	China	10.98
2008	9.6	China	11.73
2009	9.2	China	12.926
2010	10.4	China	13.576
2011	9.2	China	14.322
2005	5.3	South Africa	0.714
2006	5.6	South Africa	0.718
2007	5.5	South Africa	0.72
2008	3.6	South Africa	0.727
2009	-1.5	South Africa	0.722
2010	2.9	South Africa	0.706
2011	3.1	South Africa	0.704

**--------------code.------------------------------*
gen country1=.
replace country1=1 if country=="Brazil"
replace country1=2 if country=="Russia"
replace country1=3 if country=="India"
replace country1=4 if country=="China"
replace country1=5 if country=="South Africa"

label define country1 1 "Brazil" 2 "Russia" 3 "India" 4 ///
"China" 5 "South Africa"
label values country1 country1

 drop country
 rename country1 country


table  country  year [aweight=weight], c(mean gdp_growth) row



--
Best Wishes,

Abu Camara
*
*   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