Announcement

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

  • Egranger - sample may not include multiple panels

    Hi guys,

    Really frustrating problem here. Downloaded the egranger command from ssc. I am trying to use the command in my panel data setting. However whenever I execute the code it returns the error code - 'sample may not include multiple panels'.

    Can anyone guide me from where I am going wrong to the right path? I would be grateful.

    Thanks

    John

  • #2
    Just to add a further bit of information:

    I have my panel set up like the following:

    I have 31 countries and years range from 1980 to 2011. So my data reads like:

    Country A|1980
    ......................
    Country A|2011


    Country B|1980
    ......................
    Country B|2011

    Comment


    • #3
      What's the puzzle precisely? You don't show us your code -- please note http://www.statalist.org/forums/help#stata for future posts -- but the error message should be clear. The command doesn't pool panels (statement of ignorance: I have no idea whether such a test is defined) or produce repeated tests.

      You can test individual panels one at a time, e.g.

      Code:
      webuse grunfeld, clear
      egranger invest mvalue if company == 1
      Last edited by Nick Cox; 12 Aug 2016, 11:12.

      Comment


      • #4
        Hi Nick,

        Thank you for your response. I appreciate it. I apologise for the wrong format.

        I am using egranger from ssc in stata 14. Here provided is a link to a detailed description of the command - http://fmwww.bc.edu/RePEc/bocode/e/egranger.html

        My issue is that the literature uses this command in panel data. However when I use the command, the error term 'sample may not include multiple panels' is returned.

        Code:
        tsset time
        error repeated time values in sample
        
        tsset country
        error repeated time values in sample
        
        
        xtset country year
        panel variable:  country (strongly balanced)
        time variable:  Year, 1980 to 2011
        delta:  1 unit
        
        egranger y x 
        error sample may not include multiple panels


        I am confused by what this error precisely means (and I have clicked on the error in stata but their explanation was not illuminating).
        I also seek help on how to properly execute this command.

        I hope my format is improved and allows for easier reading. Thank you for your time in reading my problem.

        John

        Comment


        • #5
          Sorry, but I can't add to my previous answer to the effect that,

          1. regardless of what is defined in the literature, the egranger command won't support multiple panel tests

          2. you can get results for one panel by selecting that panel: I gave a reproducible example you can try.

          Comment


          • #6
            Hi Nick,

            Thank you for your patience nonetheless. Just on point 2, where is the example? I don't appear to have anything in my inbox.

            Thank you again

            John

            Comment


            • #7
              There is reproducible code in #3 in this thread.

              Comment


              • #8
                Originally posted by Nick Cox View Post
                There is reproducible code in #3 in this thread.
                Oh sorry, yes I see. One more question if you don't mind Nick?

                I ran the code from #3. However stata has returned the error saying that the expression is too long. I am defeated.

                Comment


                • #9
                  Nick I have found my solution to everything. I am both an idiot but happy with myself. As you say it was. I misread the literature. You were right. Many thanks for your patience. I really appreciate it. I hope you have a good weekend.

                  Comment

                  Working...
                  X