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
how to calculate the moving average for a variableDear all I am trying to calculate the average bond maturity over the preceding three months as an i…
Intuition on why Fixed-effects models depend on there being variation within the unit of analysis.I am new to econometrics and tried to find the answer on google, but couldn't find any. I've learned…
EFA-Factor AnalysisHello, I have survey data where five main factors and each factor has a set of questions. As we kno…
ivreg2-weak instrument robust inferenceDear All, I was a bit confused about the validity of estimates after ivreg2. If the Kleibergen-Paap…
Dropping observations after the first time the treatment turns offHello, I need some help finding a solution to the following problem: I want to drop all the observat…
Subscribe to:
Post Comments (Atom)
0 Response to Grouping and Panel Data
Post a Comment