I am carrying out a study using panel data I would like t group the countries into regions, which I have been able to do using the following command:
generate region = 5
replace region = 1 if inlist(country, "Burundi", "Kenya", "Uganda", "Rwanda", "Mauritius")
replace region = 2 if inlist(country, "Burkino Faso", "Togo", "Mali", "Nigeria", "Mauritania", "Senegal")
replace region = 3 if inlist(country, "Egypt", "Sudan", "Morocco", "Tunisia", "Algeria")
replace region = 4 if inlist(country, "Eswatini", "Botswana", "Namibia", "Lesotho", "South Africa")
replace region = 5 if inlist(country, "Cameroon", "DR Congo", "Gabon")
Nevertheless, when I tabulated it using 'tab region', I realised that though the total value of the observations are correct, the values in each of the regions are not correct. How do I correct this?
Please note that the panel is unbalanced.
Thank you.
Related Posts with Grouping and Panel Data
Bivariate Kernal Estimation - optimal bandwidth choiceDear all: I am writing to see if anyone knows a Stata command that helps set the optimal bandwidth …
Interpreting odds ratio in logit modelsFor my xtlogit model (though Stata shows "Random-effects logistic regression" in the table it produc…
Wishlist for Stata JournalDear All, I wish that some Stata experts can offer a VERY USEFUL command to implement PSM+DID (prope…
How to rank and form portfolioHi. I need help to form rank and portfolio by following the procedure below (step 1 to 3). The code …
Comparing the seasonal naive method with Holt-Winters' additive seasonal exp. smoothing method using ts cross-validationHello, Can someone help me with using cross-validation to compare the seasonal naive method with Ho…
Subscribe to:
Post Comments (Atom)
0 Response to Grouping and Panel Data
Post a Comment