Announcement

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

  • spxtregress, xsmle, fe

    I have a (seemingly) simple question:

    Are these essentially the same command?

    spxtregress pm25 fire_acres i.month i.year, fe dvarlag(W) errorlag(W)

    xsmle pm25 fire_acres i.month i.year, fe wmat(W) emat(W) model(sac)


    As expected the coefficients are close in value (though not numerically identical). However, the predictions from these commands are wildly different. It doesn't matter which options I use (rform, xb, etc.)

    I know I have not included the required information recommended by the forum, but I was hoping someone knows the answer based on how the commands operate, since the readout is relatively uninformative. If someone is willing to take a gander, I can provide the data, code, and whatever else.

    Thanks,
    Alex


  • #2
    Sometimes if you ask questions about discipline-specific Stata procedure, the chance that you get an answer will be very slim. Fortunately, authors of -xsmle- have account in this forum, so perhaps you can try to contact Federico Belotti Andrea Piano Mortari.

    Comment


    • #3
      From the description of the commands, I would also expect that both estimate the same model. I have tried it with one of my own data sets (without time dummies) and the results were different (not even quite close). I am also surprised that spxtregress does not allow me to include time dummies:
      Code:
      i.timevar not allowed when option dvarlag() or errorlag() is specified
      r(198);
      https://www.kripfganz.de/stata/

      Comment


      • #4
        Originally posted by Sebastian Kripfganz View Post
        I am also surprised that spxtregress does not allow me to include time dummies:
        Code:
        i.timevar not allowed when option dvarlag() or errorlag() is specified
        r(198);
        I'm struggling to understand this as well. I read on the "Stata Spatial Autoregressive Models Reference Manual, Release 17", at page 206, Example 2:
        The i.year dummies are not allowed because spxtregress, fe assumes individual fixed effects only, as specified in section 2 of Lee and Yu (2010a).
        At the beginning I thought: “No, it’s variables that only vary ACROSS SPACE that are incompatible with SPACE fixed-effects, not those that only vary ACROSS TIME!” - as also stated at page 195 of the same Manual:
        Only covariates that vary within panels can be fit with this estimator.
        But then I started working on the dataset from that example (https://www.stata-press.com/data/r17..._1960_1990.dta) and I realized that, as the error message you report mention, a time fixed-effect is ruled out by the simultaneous presence of a space fixed-effect and of spatial dependence (be it through a spatial lag, or a spatial autoregressive term).
        I took a look at the reference the Manual makes: https://reader.elsevier.com/reader/s...20230315150615
        and reached the conclusion that the issue is not about identification (as in the case variables only varying across space) but about estimation, and in particular about "short T" samples. In fact, Section 2 of the paper distinguishes between the “large T” and the “fixed T” case, and talks about the use of a T/(T-1) correction factor to get unbiased estimates. In particular, if I well understand, Section 2.2 talks about the issue of introducing a linear dependence by considering deviations from the mean of each panel: my interpretation is that, if we force the mean of a group of observations to be null, we introduce a negative correlation between them.
        Maybe someone with a better understanding of the topic and less aversion to algebra may clarify this better.







        Comment


        • #5
          The key takeaway from the referenced article about time effects can be found in Section 3 (Theorems 3 and 4 and the immediately following paragraphs). In a nutshell, using time dummies when T is fixed is generally fine; i.e. coeffient estimators are consistent under large-N asymptotics. One may have to use robust standard errors, though.
          https://www.kripfganz.de/stata/

          Comment


          • #6
            Originally posted by Sebastian Kripfganz View Post
            In a nutshell, using time dummies when T is fixed is generally fine; i.e. coeffient estimators are consistent under large-N asymptotics. One may have to use robust standard errors, though.
            From what I see, however, robust standard errors for models allowing for spatial dependence are allowed with "spregress" (for cross-sectional data), not with "spxtregress" (for panel data).

            Comment

            Working...
            X