Announcement

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

  • FE regression with gpreg - Error: __000004 not found

    Hi,

    I have the following dataset:
    HTML Code:
    fundid    Domicile    date    weighting    IR
    14994056    United States    30jun2014    40.73576    .0011333
    12217413    United States    31aug2013    .53653    .0012333
    13619906    United States    31dec2013    10.52529    .0012667
    14544742    Canada    31may2014    99.83504    .0117397
    11389637    Canada    28feb2013    37    .0116
    13884940    United States    28feb2014    2.27623    .0012333
    14035402    United States    31mar2014    .90946    .0012333
    12607260    Canada    31oct2013    .25272    .0116861
    12358598    United States    31aug2013    32.01303    .0012333
    I am trying to run the following fixed effect regression (large number of fixed effect "fundid"):
    Code:
    gpreg weighting IR, ivar(Domicile) jvar(fundid)
    I am getting the following error:
    Twoway Fixed Effects Estimation: gpreg
    __000004 not found
    r(111);


    How can I fix that? Thanks

  • #2
    Originally posted by Florent Rouxelin View Post
    How can I fix that? Thanks
    The first things I'd recommend is to re-read the list's FAQ (scroll up to find its tab), in particular Sections 3 and 12.

    Comment


    • #3
      GPREG: Stata module to estimate regressions with two dimensional fixed effects

      I was coded by Johannes F. Schmieder
      "Estimation of regressions with two dimensions of fixed effects, e.g. worker and firm fixed effects, student and teacher, or patient and doctor fixed effects. This program uses the Guimaraes & Portugal algorithm which has the advantage of being very memory efficient. It also calculates the correct standard errors under the assumption that the error term is homoskedastic and independently distributed."

      Comment


      • #4
        I'm not well versed on the differences between -gpreg- and -reg2hdfe- (from Paulo Guimaraes, the author you just mentioned) so I don't know what's the particular tempvar bug being triggered.

        That said (and at the risk of sounding crass), I would suggest you to try the -reghdfe- package instead, which uses an improved version of Guimaraes and Portugal (it's on SSC).

        Best,
        S

        Comment


        • #5
          HI Sergio,

          I have ran the same regression a follow:
          Code:
          reghdfe weighting IR, a(Domicile1 fundid)
          I am getting the following output:
          HTML Code:
          . reghdfe weighting IR, a(Domicile1 fundid)
          (warning: variable weighting is probably collinear with the fixed effects, maybe try a tighter toleranc
          > e)
          (warning: variable IR is probably collinear with the fixed effects, maybe try a tighter tolerance)
          note: IR omitted because of collinearity
          (warning: variable  is probably collinear with the fixed effects, maybe try a tighter tolerance)
          
          HDFE Linear regression                            Number of obs   =      29478
          Absorbing 2 HDFE indicators                       F(   0,      0) =       0.00
                                                            Prob > F        =          .
                                                            R-squared       =     1.0000
                                                            Within R-sq.    =     0.0000
          
          ------------------------------------------------------------------------------
             weighting |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                    IR |          0  (omitted)
          -------------+----------------------------------------------------------------
              Absorbed |       F(29477, 0) =          .       .             (Joint test)
          ------------------------------------------------------------------------------
          
          Absorbed degrees of freedom
          ------------------------------------------------------------------------------
           Absorbed FE |  Num. Coefs.  =   Categories  -   Redundant     |    Corr. w/xb
          -------------+-------------------------------------------------+--------------
           i.Domicile1 |            2               2              0     |             .
              i.fundid |        29476           29478              2     |             .
          ------------------------------------------------------------------------------
          How can I change the specification? Thanks

          Comment


          • #6
            Check your dataset. It seems as it is not a panel data and just a cross-section, because absolutely everything in the results point to a collinearity problem:
            • R2 is 1.00, that means "weighting" is completely explained by i.fundid.
            • Same for your other variables, as mentioned in the "warning" above.
            So all in all, check the structure of your dataset. You should have another dimension (like time) besides fundid in order for this to work.

            Best,
            S

            Comment


            • #7
              Here is a sample:
              HTML Code:
              fundid    date    weighting    IR    high_low_IR    Domicile1
              10563670    31dec2012    20.08959    .0023333    1    United States
              10563671    31dec2012    41.89537    .0023333    1    United States
              10563672    31dec2012    29.6572    .0023333    1    United States
              10563676    31dec2012    1.95216    .0023333    1    United States
              10563677    31dec2012    1.4068    .0023333    1    United States
              10574930    31jan2013    8.4    .0116    1    Canada
              10574931    31jan2013    24    .0116    1    Canada
              10574933    31jan2013    3.4    .0116    1    Canada
              10574937    31jan2013    3.3    .0116    1    Canada
              IR (interest rate) is the same for any given date/Domicile1.

              Although, I realize that I do not use the variable "date" in the regerssion. Where should it be?

              Comment


              • #8
                Florent,

                I can only second Sergio's advice: Check your dataset and be clear about its structure. From the snapshot you provide, we still cannot conclude if this really is a panel dataset or not, although from the output you previously provided, I take that you try to estimate 29480 coefficients with 29478 observations, which would be impossible - hence your results. This also points to your dataset being a cross-section, as Sergio says. You have one observation for each fund at one specific point in time. Thus, to me, what you are trying to do does not really make sense. Maybe it would become clearer if you told us what you want to explain.

                Best,
                Martin

                Comment

                Working...
                X