Hello everyone,
I am working with the Ease of Doing Business Report by he World Bank. My data is currently in the wide format and resembles this (values are random, this is just to replicate the structure of the data:
I want to reshape it to the wide format so it looks something like this:
With
i receive the error, that "variable id does not uniquely identify the observations".
I am not really grasping the concept of the syntax for reshape, to be honest.
Does anyone have suggestions how to do this and maybe has some pointers on how reshape is structured?
Best,
Maurice
I am working with the Ease of Doing Business Report by he World Bank. My data is currently in the wide format and resembles this (values are random, this is just to replicate the structure of the data:
country | indicatorname | YR2004 | YR2005 | YR2006 |
Afghanistan | Starting a business | 82 | 83 | 83 |
Afghanistan | Enforcing Contracts | 16 | 18 | 19 |
Afghanistan | Trading across borders | 20 | 21 | 19 |
Afghanistan | Ease of Doing Business | 17 | 8 | 19 |
Albania | Starting a business | 99 | 95 | 91 |
Albania | Enforcing Contracts | 21 | 23 | 25 |
Albania | Trading across borders | 27 | 28 | 28 |
Albania | Ease of Doing Business | 24 | 25 | 24 |
country | YR | Starting a business | Enforcing Contracts | Trading across borders | Ease of Doing Business |
Afghanistan | YR2004 | 82 | 16 | 20 | 17 |
Afghanistan | YR2005 | 83 | 18 | 21 | 8 |
Afghanistan | YR2006 | 83 | 19 | 19 | 19 |
Albania | YR2004 | 99 | 21 | 27 | 24 |
Albania | YR2005 | 95 | 23 | 28 | 25 |
Albania | YR2006 | 91 | 25 | 28 | 24 |
Code:
reshape long YR indicatorname, i(country) j(j)
I am not really grasping the concept of the syntax for reshape, to be honest.
Does anyone have suggestions how to do this and maybe has some pointers on how reshape is structured?
Best,
Maurice
Comment