Announcement

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

  • How to set monthly panel data in stata ?

    Hello guys, i have monthly panel data of import and want to do regression but the problem is i dont know how to set a monthly data in stata. The cross-section are consist of 3 country China, India, and Taiwan ; Time-series are monthly data from January 2014 until December 2019. Could you guys help me ?Thank you

  • #2
    If you have made your time variable proper monthly date, I think -xtset- will figure this out automatically when you xtset your data. You can also explicitly say:

    Code:
    xtset country date, monthly

    Comment


    • #3
      Joro Kolev thanks for your answer. have a nice day

      Comment


      • #4
        Hello, I have a monthly panel dataset from 2016 to 2020 for 15 countries. I tried the code
        Code:
        xtset country_id year, monthly
        I get the following error

        Code:
        repeated time values within panel
        Would you please suggest what I am doing wrong? Thank you.

        Comment


        • #5
          Hi Sanika Rr ,
          Could you please show us what your data, more importantly, your "year" variable looks like? As Joro Kolev suggests, it might be that your date variable is not in a perfect date format.
          Kind regards,
          Jorge

          Comment


          • #6
            A monthly panel dataset requires an identifier and a monthly date variable. The invocation , monthly is not sufficient.

            Comment


            • #7
              I went and rechecked this, and first generated a date variable for year and month. There were a few repeat entries after deleting which i could set it as panel data. Thank you for your help.

              Comment

              Working...
              X