Announcement

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

  • XSMLE: Spatial Panel Estimation... And Post-Estimationg Diagnostics

    Dear List,

    I am analyzing a spatial panel dataset using the XSMLE package. My units are a subset of US states (11) and my panel is strongly balanced. After searching both the Stata List and online extensively, I've got a few questions I can't seem to answer:
    • If a standard Hausman test indicates that an RE model is appropriate, does that results extend to a spatial panel? I've found some papers referencing a spatial Hausman test in R, but I haven't found any info on how to run this in Stata. Any thoughts here?
    • Because I've got some nonlinear Ys, I have respecified my model to include some cubic and quartic terms that, based on the literature, I think will account for the nonlinear patterns. I have run a Ladder test, but the terms with the lowest Chi2 aren't significant in my model. Is the ladder test appropriate for a spatial panel dataset?
    • What's the best way to assess high leverage observations when running XSMLE? Should I just estimate a pooled OLS model and then calculate DFBETA and Cook's D or is there another approach?
    • I've read the presentation that Belotti, Hughes and Mortari (2013) created on XSMLE, but are there any additional resources I can reference? I'm struggling in particular to understand how to interpret the Main, Spatial, Variance, Direct and Indirect results that the package produces.
    Thanks in advance for any assistance or resource!

    -Nick

  • #2
    Dear Nick:

    1) -xsmle- implements the Hausman test through the -hausman- option;
    2) What do you mean for nonlinear Ys?
    3) Why -xsmle- should require a different way to detect outliers? Anyway, if you suspect the presence of influential observations, you should avoid ML and -xsmle-;
    4) We are working on a (hopefully) SJ paper for -xsmle-.

    Hope this helps
    Best
    Federico

    Comment


    • #3
      Federico,

      Thank you for your comments and the XSMLE package. Are there any "handbook" style resources for spatial panel analysis in Stata that you can recommend?

      I have read the LeSage and Pace book and the portion on spatial panels is quite small. Most of the other textbooks I have found that show applications and best practices for spatial regression are focused on R. If you have any notes associated with your 2013 presentation, please let me know.

      Thanks again,

      -nick

      Comment


      • #4
        Dear List,

        I've a quick observation which I would like to run by people. I'm running two estimations, a standard

        Code:
        xtreg indvar depvars, fe cluster(panelid).[
        I am also running a similar spatial regression.

        Code:
        xsmle indvar depvars, wmat(v) model(sdm) fe cluster(panelid) nsim(500) nolog
        All variables are in logs.

        My initial regression gives a higher r2 than my spatial one. Is this normal, or could it be a case of misspecification in regards to the spatial model?

        Comment


        • #5
          Dear List,
          I am running a spatial autocorrelation regression with panel data using -xsmle- package. I also have trouble interpreting the result of the Main, Wx, sigma2_e, Direct and Indirect coefficents that -xsmle- generates. Is there any new update on this?
          Thank you for any assistance!
          Chi Pham
          Last edited by Chi Pham; 14 Mar 2016, 13:32.

          Comment


          • #6
            Dear Chi Pham

            As I know that the Main result could be explained as a change of dependence variable y in unit i caused by the change of independence variable x of unit i. The direct coefficient could be explained as the same way but it also account for the term "feedback effect", average for all unit.

            The Wx could be explained as the change variable x of all unit (except unit i) would cause the change in dependence variable y of unit i. The indirect effect also be explained as Wx but it again include the feedback effect.

            Comment


            • #7
              Dear Le Thang,
              Thank you so mush for your explanation! This helps a lot!
              So the sigma2_e is just the overall variance of the model?

              Comment


              • #8
                Hi -- I'd like to bump this thread. I'm still interested if there's any more to say about Nick's third question above:
                • What's the best way to assess high leverage observations when running XSMLE? Should I just estimate a pooled OLS model and then calculate DFBETA and Cook's D or is there another approach?
                The post-estimation options after XSMLE don't include, as far as I can tell, any help with leverage, cook's d, etc. Are there any other options?

                Ethan

                Comment


                • #9
                  Dear List,

                  I got a question regarding XSMLE and the use of fixed effects. I have a panel data set of 7 years and want to include time as well as unit fixed effects and of course want to use the bias correction procedure developed by Lee and YU (2010).
                  But I am not sure about the exact code though. I know that XSMLE has this possibilty to use "type(ind, leeyu)" but in this case only individual fixed effects will be implemented, right? It is not working for both... such "type(both, leeyu)"

                  So my question is how I can proceed?
                  Is it: xsmle y x1 x2 i.year, fe wmat(W) dmat(W) model(sdm) vce(cluster id) type(ind, leeyu) ?? Or what else?

                  Thanks a lot,
                  Bastian
                  Last edited by Bastian Longer; 06 Jul 2017, 09:04.

                  Comment


                  • #10
                    Hi Bastian,

                    as it says here: http://www.stata.com/meeting/germany...13_mortari.pdf (slide 8),
                    leyu only works with ind. I'm not sure wether this is a restriction of the bias correction method or just of the xsmle-package,
                    so maybe you can code it yourself.

                    Best of luck,

                    Tim Umbach

                    Comment


                    • #11
                      Guys, I've got another question: When I use the SDM Model with time fixed effects the ML estimator does not converge - it stops after iteration 100 with the statement 'convergence not achieved'. (It converges when I forego the time fixed effects) Even after scaling up iteration size (e.g. 5000) it does not converge.

                      Do you have any idea what I can do about it? Respectively, do you think the results are reliable?


                      Thanks a lot!
                      Last edited by Bastian Longer; 12 Jul 2017, 02:49.

                      Comment


                      • #12
                        Another question on a comment of Frederico Belotti on how to create a spatially lagged variable in: http://www.econometrics.it/?p=312&cpage=1#comments

                        Does anyone know how the spatially lagged variables can be created? His recommendation in the comments section is:

                        sort time id
                        mata: w_y = J(0,1,.)
                        mata: W = st_matrix("W")
                        forvalues t = 1/5 {
                        putmata y`t'=y if time == `t', replace
                        mata: w_y`t' = W*y`t'
                        mata: w_y = w_y \ w_y`t'
                        }
                        getmata w_y, replace


                        But this does not work in Stata for me... w_y is always empty respectively filled with dots, as is stated in 'mata: w_y = J(0,1,.)'.

                        Do you have an idea?

                        Thanks a lot!

                        Comment


                        • #13
                          Originally posted by Tim Umbach View Post
                          Hi Bastian,

                          as it says here: http://www.stata.com/meeting/germany...13_mortari.pdf (slide 8),
                          leyu only works with ind. I'm not sure wether this is a restriction of the bias correction method or just of the xsmle-package,
                          so maybe you can code it yourself.

                          Best of luck,

                          Tim Umbach
                          As Tim pointed out, -xsmle- allows the -leeyu- option in the case of a model with individual effects only. This is a limitation of the command since Lee and Yu (2010) actually proposed the transformation approach also in the case of a general model with both individual and time effects. However, we chose to not implement it since, unless both n and T go to \infty, it requires a bias correction for the entire parameter vector, not only for \sigma^2.



                          Federico

                          Federico

                          Comment


                          • #14
                            Originally posted by Bastian Longer View Post
                            Dear List,

                            I got a question regarding XSMLE and the use of fixed effects. I have a panel data set of 7 years and want to include time as well as unit fixed effects and of course want to use the bias correction procedure developed by Lee and YU (2010).
                            But I am not sure about the exact code though. I know that XSMLE has this possibilty to use "type(ind, leeyu)" but in this case only individual fixed effects will be implemented, right? It is not working for both... such "type(both, leeyu)"

                            So my question is how I can proceed?
                            Is it: xsmle y x1 x2 i.year, fe wmat(W) dmat(W) model(sdm) vce(cluster id) type(ind, leeyu) ?? Or what else?

                            Thanks a lot,
                            Bastian
                            The Lee and Yu (2010) transformation approach in the case of a general model with both individual and time effects cannot be implemented using -xsmle-. You need to code it from pag. 169-172 of L.-f. Lee, J. Yu, Journal of Econometrics 154 (2010).
                            Federico

                            Comment


                            • #15
                              Originally posted by Bastian Longer View Post
                              Another question on a comment of Frederico Belotti on how to create a spatially lagged variable in: http://www.econometrics.it/?p=312&cpage=1#comments

                              Does anyone know how the spatially lagged variables can be created? His recommendation in the comments section is:

                              sort time id
                              mata: w_y = J(0,1,.)
                              mata: W = st_matrix("W")
                              forvalues t = 1/5 {
                              putmata y`t'=y if time == `t', replace
                              mata: w_y`t' = W*y`t'
                              mata: w_y = w_y \ w_y`t'
                              }
                              getmata w_y, replace


                              But this does not work in Stata for me... w_y is always empty respectively filled with dots, as is stated in 'mata: w_y = J(0,1,.)'.

                              Do you have an idea?

                              Thanks a lot!
                              This code should work if the Stata spatial weight matrix "W" has been previously created and should be adapted to handle cases where the time variable does not vary from 1 to 5.
                              Federico

                              Comment

                              Working...
                              X