Announcement

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

  • Using wbopendata [replicating tutorials by Joao Pedro Azevedo]

    I am following the video examples by Joao Pedro Azevedo from the GitHub link below:
    https://github.com/jpazvd/wbopendata.../wbopendata.md
    From example 7, "Map latest values of global mobile phone coverage" when i execute the following commands:
    Code:
    qui tempfile tmp
    wbopendata, language(en - English) indicator(it.cel.sets.p2) long clear latest
    local labelvar "`r(varlabel1)'"
    sort countrycode
    sort countrycode
    save `tmp', replace
    qui sysuse world-d, clear
    qui merge countrycode using `tmp'
    The last code :qui merge countrycode using `tmp' returns the error:
    Code:
    filelist required
    Can anyone help to understand what "filelist" to provide to complete the mapping?
    Thanks.
    David.

  • #2
    First, your -merge- syntax is wrong. You must tell Stata whether the merge is to be 1:1, m:1, or 1:m, and that must come between merge and countrycode, unless you are using a truly archaic version of Stata.

    But I'm pretty sure the error message that provokes would be different from the one you are getting. Are you sure that is exactly the code you ran?

    The other possibility is that you did not run the entire block of code in one fell swoop but did so line by line or in blocks, with the -merge- command being run separately from the -tempfile- command. In that case, the local macro tmp defined in the -tempfile- command would have gone out of scope: a block of commands run together in a do-file is considered a program and macros defined within it evaporate at the end of that block. So when Stata parses -using `tmp' it sees only -using- with no file. That would provoke the filelist required error message.

    Comment


    • #3
      Thank you, Clyde Schechter. Running all the commands at a go worked out perfectly.

      Comment


      • #4

        However,the spmap command

        Code:
        . spmap  it_cel_sets_p2 using "world-c.dta", id(_ID)                                  ///
                        clnumber(20) fcolor(Reds2) ocolor(none ..)                                  ///
                        title("Mobile cellular subscriptions (per 100 people)", size(*1.2))         ///
                        legstyle(3) legend(ring(1) position(3))                                     ///
                        note("Source: World Development Indicators (latest available year: `avg') using ///
                        Azevedo, J.P. (2011) wbopendata: Stata module to " "access World Bank databases, ///
                        Statistical Software Components S457234 Boston College Department of Economics.", ///
                                        size(*.7))
        Returns the error
        Code:
        File world-c.dta not found
        But
        Code:
        sysuse dir
        indicates that "world-c.dta" is present in the directory. Kindly help me on this error. Thank you.

        Comment


        • #5
          I do not use spmap and no nothing about it. However, on the assumption that it follows official Stata rules for syntax, I conclude that the problem is that world-c.dta is in the wrong place. The fact that it shows up with -sysuse dir- tells me that it is probably located among the Stata files in your ado directory. But under standard syntax, as you provide no path before the filename in your -using- specification, Stata will expect to find it in your present working directory. So you can either use the full pathname of the world-c.dta in your -spmap- command (If you run -sysuse world-c- and then -return list-, r(fn) will show you the full path.) or you can copy world-c.dta to the current working directory. (If you don't know what your present working directory is, -pwd- will show it to you.

          Comment

          Working...
          X