Announcement

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

  • Panel Data Regression

    I have micro-level data from 7 countries for 3 years (7 Countries * 3 years * 5000 individuals).
    The data is not a panel at the individual level. (That is there is no ID at the individual level)
    I want to run panel data regression on this data to verify the country effect and year effect.

    I am new to panel data regression.
    Can someone suggest me how to go about this?

  • #2
    Vimal:
    welcome to this forum.
    As per your description, in your case countries represent your -panelid-.
    By the way, there's no methodological reason that supports individual as the only possible -panelid-.
    That said, if you have data on individuals nested within countries (or other higher level variable that expresses grouping), you should consider -mixed-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Sir, Thank you for quick your response.

      I tried running panel regression. Stata says the ID and Year combination should be unique.
      But in my case, as each country has individual data, I will have many Year * Country combination.
      For example, Kenya has n = 3000. So for 3 years, we have 3 * 3000 = 9000 records. Then similarly for Tanzania or India.
      But, Stata expects, country * year to be unique. India_ 2015 one record, India_2016 one record and so on.
      So, now I am confused what do I do with 3000 individuals. What should be my ID?

      Objective my study is to compare one country with the other and within-country how things have change year by year.

      Comment


      • #4
        Vimal:
        if you do not plan to use time-series commands, such as lags and leads, you can simply:
        Code:
        xtset <panelid>
        without a <timevar>.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Sir,

          Here is a screenshot of my dataset.
          The country variable has seven different values (India, Bangladesh, Kenya and so on) and Year Variable has 3 years (2015, 2016, 2017)

          Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	29.4 KB
ID:	1454571


          When I try xtset:

          Code:
          . encode country, gen(cntry)
          
          . xtset cntry year
          repeated time values within panel
          r(451);
          I am getting the error, "repeated time value within panel"...

          Please suggest me some workarounds...

          Thank you,

          Regards,
          Vimal

          Comment


          • #6
            Vimal:
            - as per FAQ, please do not post screenshots, but share what you typed and what Stata gave yopu back via CODE delimiters and/or provide and excerpt/example of your data via -dataex-. Thanks;
            - as per my previous reply, you can avoid Stata error message via:
            Code:
            xtset country
            The abovementioned workaround implies that you do not plan to use -tsvarlist- commands, such as leads and lags, in your panel data regression.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Hello Sir,

              Sorry for the screenshot. Will not post again.

              I ran the code as you mentioned:

              Code:
              . xtset cntry
                     panel variable:  cntry (unbalanced)
              
              . xtologit useph age ppiscore
              
              Fitting comparison model:
              
              Iteration 0:   log likelihood = -211781.22  
              Iteration 1:   log likelihood = -205756.18  
              Iteration 2:   log likelihood = -205697.47  
              Iteration 3:   log likelihood = -205697.44  
              Iteration 4:   log likelihood = -205697.44  
              
              Refining starting values:
              
              Grid node 0:   log likelihood = -205680.04
              
              Fitting full model:
              
              initial values not feasible
              r(1400);
              I am getting the error: "Initial Values not feasible".

              Can you help me with this?

              Thank you again,

              Regards,
              Vimal


              .

              Comment


              • #8
                Vimal:
                see Technical note on quadrature, -xtologit- entry, Stata .pdf manual, page 312.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Dear Sir,

                  Thank you for your patience.
                  I am sorry. I am really new to this.

                  I tried changing intpoints(), as mentioned for quadrature.

                  I am getting the same error.

                  Thank you,

                  Regards,
                  Vimal


                  Comment


                  • #10
                    Vimal:
                    see -quadchk- entry in Stata .pdf manual.
                    Otherwise, check whether your regression model is correctly specified.
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment

                    Working...
                    X