Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • World Bank data downloading error using --wbopendata--

    Stata12SE on windowsXp,

    I use --wbopendata-- package from net install wbopendata

    I have an error only with category #8 I used the following command and got the following error message:

    wbopendata, language(en - English) country() topics(8 - Health) indicator() long clear

    i=countryname countrycode indicatorname indicatorcode does not uniquely identify the observations;
    there are multiple observations with the same value of countryname countrycode indicatorname indicatorcode.
    Type "reshape error" for a listing of the problem observations.

    Anybody has an idea how to deal with that!

  • #2
    Sami,

    I don't know enough about wbopendata to precisely answer your question, but I would suggest omitting the long option and doing your own reshape. (Actually, you should find that the data has already been downloaded in wide format even though you got an error.) It appears that the country, topic, and indicator options you specified result in duplicates for the variables that are used to do the reshape. Once you successfully download the data in wide format, you can investigate on your own what needs to be done to get it into long format. There may be some adjustments you can make or you may need to change your download command to provide more variables that can make each observation unique.

    Regards,
    Joe

    Comment


    • #3
      Sami,

      Upon further inspection it looks like the duplicates are exactly the same for every variable. I don't know what might cause this, but you may be able to just drop the duplicates and do a reshape:

      Code:
      wbopendata, language(en - English) country() topics(8 - Health) indicator() clear
      duplicates report countryname countrycode indicatorname indicatorcode
      duplicates report *
      duplicates drop *, force
      reshape long yr, i (countryname countrycode indicatorname indicatorcode) j(year)
      Even though this works, I would strongly advise you to investigate further why you are getting duplicates. They look like exact duplicates, but without knowing more about the data it's hard to say for sure.

      Regards,
      Joe

      Comment


      • #4
        Joe,

        I guess the problem is at side of the WB database because the error occurs only with category #8, while things worked fine with the other 15 categories.

        Thanks for investigating it!

        Best, Sami

        Comment

        Working...
        X