Announcement

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

  • insufficient observation error on using xtreg re and all variables omitted in xtreg fe

    Dear Experts, I am using xtreg fe and xtreg re on my panel dataset of 2921 firms. I have declared the data to be panel by xtset ID YEAR. The problem i face is all independent variables are omitted in case of xtreg fe and insufficient observations is the response i get when i try xtreg re. However xtreg mle gives the output. I have checked the data for missing values with "mdesc" command. There are no missing values in my data Please help me solve this issue. Below i am pasting the model code wth STATA's response:

    . xtreg logTLR Size AGR Assets_Turnover SGR ICR RONW logprofitability logtax_burden logliquidity, re
    insufficient observations
    r(2001);

    . xtreg logTLR Size AGR Assets_Turnover SGR ICR RONW logprofitability logtax_burden logliquidity, fe
    note: Size omitted because of collinearity
    note: AGR omitted because of collinearity
    note: Assets_Turnover omitted because of collinearity
    note: SGR omitted because of collinearity
    note: ICR omitted because of collinearity
    note: RONW omitted because of collinearity
    note: logprofitability omitted because of collinearity
    note: logtax_burden omitted because of collinearity
    note: logliquidity omitted because of collinearity

    Fixed-effects (within) regression Number of obs = 49,657
    Group variable: ID Number of groups = 49,657

    R-sq: Obs per group:
    within = . min = 1
    between = . avg = 1.0
    overall = . max = 1

    F(0,0) = 0.00
    corr(u_i, Xb) = . Prob > F = .

    ----------------------------------------------------------------------------------
    logTLR | Coef. Std. Err. t P>|t| [95% Conf. Interval]
    ----------------- -------- +----------------------------------------------------------------
    Size | 0 (omitted)
    AGR | 0 (omitted)
    Assets_Turnover | 0 (omitted)
    SGR | 0 (omitted)
    ICR | 0 (omitted)
    RONW | 0 (omitted)
    logprofitability | 0 (omitted)
    logtax_burden | 0 (omitted)
    logliquidity | 0 (omitted)
    _cons | .8852116 . . . . .
    -----------------+----------------------------------------------------------------
    sigma_u | 1.3029188
    sigma_e | .
    rho | . (fraction of variance due to u_i)
    ----------------------------------------------------------------------------------
    F test that all u_i=0: F(49656, 0) = . Prob > F = .












    Last edited by DILAWAR AHMAD BHAT; 21 Aug 2019, 03:22.

  • #2
    Dilawar:
    welcome to this forum.
    Have you checked how many of your predictors vary with time?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo, Almost all of my predictors vary over time. In case of xtreg re, why is it returning "insufficient observations" error although I have data for 17 years on each firm in the panel. However the output in xtreg mle shows number of groups =number of observations(49657). The number of groups(firms) should be 2921. Please help me solve this issue asap.



      Attached Files
      Last edited by DILAWAR AHMAD BHAT; 21 Aug 2019, 04:35.

      Comment


      • #4
        what do you get as output if you type just -xtset- ? That is xtset followed by nothing else.

        Comment


        • #5
          Originally posted by Eric de Souza View Post
          what do you get as output if you type just -xtset- ? That is xtset followed by nothing else.

          . xtset
          panel variable: ID (weakly balanced)
          time variable: YEAR, 2002 to 2018
          delta: 1 year

          Comment


          • #6
            It says "weakly balanced" and not "strongly balanced" or unbalanced.
            A last try from me. Could you produce the output from:
            tab YEAR
            and from
            sum YEAR

            Comment


            • #7
              Originally posted by Eric de Souza View Post
              It says "weakly balanced" and not "strongly balanced" or unbalanced.
              A last try from me. Could you produce the output from:
              tab YEAR
              and from
              sum YEAR

              . tab YEAR

              YEAR | Freq. Percent Cum.
              ------------+-----------------------------------
              2002 | 2,921 5.88 5.88
              2003 | 2,921 5.88 11.76
              2004 | 2,921 5.88 17.65
              2005 | 2,921 5.88 23.53
              2006 | 2,921 5.88 29.41
              2007 | 2,921 5.88 35.29
              2008 | 2,921 5.88 41.18
              2009 | 2,921 5.88 47.06
              2010 | 2,921 5.88 52.94
              2011 | 2,921 5.88 58.82
              2012 | 2,921 5.88 64.71
              2013 | 2,921 5.88 70.59
              2014 | 2,921 5.88 76.47
              2015 | 2,921 5.88 82.35
              2016 | 2,921 5.88 88.24
              2017 | 2,921 5.88 94.12
              2018 | 2,921 5.88 100.00
              ------------+-----------------------------------
              Total | 49,657 100.00




              . sum YEAR

              Variable | Obs Mean Std. Dev. Min Max
              -------------+---------------------------------------------------------
              YEAR | 49,657 2010 4.899029 2002 2018

              Comment


              • #8
                Originally posted by Carlo Lazzaro View Post
                Dilawar:
                welcome to this forum.
                Have you checked how many of your predictors vary with time?
                Dear Carlo, Almost all of my predictors vary over time. In case of xtreg re, why is it returning "insufficient observations" error although I have data for 17 years on each firm in the panel. However the output in xtreg mle shows number of groups =number of observations(49657) which should not be the case. The number of groups(firms) should be 2921. Please help me solve this issue asap.

                Attached Files

                Comment


                • #9
                  I don't see where the problem is. As far as I can judge your panel structure is in order. Nevertheless, Stata is saying that you have only one observation in each group whereas you should have 2921 observations in each group.
                  I hope someone else can troubleshoot the source of the problem.

                  Comment


                  • #10
                    Originally posted by Eric de Souza View Post
                    I don't see where the problem is. As far as I can judge your panel structure is in order. Nevertheless, Stata is saying that you have only one observation in each group whereas you should have 2921 observations in each group.
                    I hope someone else can troubleshoot the source of the problem.
                    thank you Eric for sparing your time.

                    Comment


                    • #11
                      I believe you have constructed your ID variable incorrectly so that it reflects not only the firm but also the year. So your panel is weakly balanced because each value of ID occurs exactly once, for one value of year.

                      Can you report the output from
                      Code:
                      xtdescribe, patterns(20)

                      Comment


                      • #12
                        Originally posted by William Lisowski View Post
                        I believe you have constructed your ID variable incorrectly so that it reflects not only the firm but also the year. So your panel is weakly balanced because each value of ID occurs exactly once, for one value of year.

                        Can you report the output from
                        Code:
                        xtdescribe, patterns(20)
                        Dear William, here is the output you asked for
                        Attached Files

                        Comment


                        • #13
                          Originally posted by William Lisowski View Post
                          I believe you have constructed your ID variable incorrectly so that it reflects not only the firm but also the year. So your panel is weakly balanced because each value of ID occurs exactly once, for one value of year.

                          Can you report the output from
                          Code:
                          xtdescribe, patterns(20)
                          Thank you so much William for pointing out the error. Special Thanks to Eric de Souza , Carlo and Clyde Schechter. It was from William's and Clyde's responses elsewhere that i was able to solve the issue. Long live stata community. From Clyde's post elsewhere i got the code egen id = group(COMPANY) which generated id by company variable.

                          Comment


                          • #14
                            Let me add this, for others who see this topic at a later date.

                            We often use xtset to remind us how the data structure was identified, and on Statalist asking for the output of xtset is common for problems like this.

                            But xtdescribe (which I am embarrassed to admit I had overlooked until recently) goes beyond xtset by describing aspects of the actual data. In this case, the first line of the output tells us that there were 49657 distinct values of ID rather than the 2921 that we expected.

                            I find myself now using xtdescribe following my initial xtset for a dataset to make sure that my understanding of the structure of the data agrees with that found by Stata.

                            Comment

                            Working...
                            X