Announcement

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

  • sureg or xtsur in a panel ?

    In a panel data, in order to estimate a seemingly unrelated regression, would it be possible to use sureg ? or I have to use xtsur?
    My problem is:
    1- I want to estimate a system as a SUR and I know from my data that there are fixed effects not random effects. xtsur fits the system using one way random effect? which I don't want to do.
    2- On the other side, is it possible to use sureg when I have a panel data set (firms and years) ? I have seen papers using seemingly unrelated regressions with year and industry fixed effects. When I try to do that, I use the command sureg (y x1 x2 x3 i.yr i.industry) (z x2 x3 x4 i.yr i.industry),corr

    is it possible to use sureg this way in a panel data ? The code works properly but I am not sure if I follow a proper approach ?

    Thanks
    Last edited by Ahmed Abdalla; 26 May 2014, 18:42. Reason: I edited the code to add the option, corr

  • #2


    In panel data, you have repeated observations on each member of the panel, and the technique you use should reflect that. You can do that correctly using -xtsur-, which is designed for it; or incorrectly using -sureg-, which is not. If you use sureg, you have to add a fixed effect for every member of the panel, and adjust the SE for clustering. The first is permitted within Stata, the second is not.

    Which ever method you choose, you can fit similar fixed effects models.

    xtsur (y x1 x2 x3 i.yr ) (z x2 x3 x4 i.yr ),corr
    (Produces a valid answer)

    or

    sureg (y x1 x2 x3 i.yr i.industry i.id) (z x2 x3 x4 i.yr i.industry),corr
    (Produces an invalid answer)

    or
    sureg (y x1 x2 x3 i.yr i.industry i.id) (z x2 x3 x4 i.yr i.industry),corr cluster(industry)
    (Produces an error message)


    Best wishes,


    Paul Seed
    Last edited by Paul T Seed; 27 May 2014, 03:06.

    Comment


    • #3
      Paul
      My problem is that xtsur always gives me a n error message, even though data are "xtset" ?

      . xtset firmid yr

      panel variable: firmid (unbalanced)
      time variable: yr, 1991 to 2012, but with gaps
      delta: 1 unit

      . xtsur (f.abn2W ceW op2W bvW divW ) ( crmv3W bvW abn2W op2W l.bvW )
      (running multi-step estimates...)

      not sorted
      st_data(): 3598 Stata returned error
      _xtsurub(): - function returned error
      <istmt>: - function returned error
      r(3598);

      Comment


      • #4
        Also, xtsur (as per the stata help) perform a one way random effect estimation of SUR in a panel data set.
        Therefore when I want to estimate the system in a panel data using industry and year fixed effects ( data has fixed rather than random effects, tested before) , I use the following command:

        sur (f.abn2W ceW op2W bvW divW i.industry i.yr ) ( crmv3W bvW abn2W op2W l.bvW i.industry i.yr )
        This works...Please note that each industry have firms in the data so I control here for industry and year fixed effects.... Is it a correct way to run sur using this code in a panel data set?

        Comment


        • #5
          Even when I xtset the data , xtsur gives the error message as per post 3.

          Comment


          • #6
            Dear All
            This post has not been resolved. Can anyone provide some possible suggestions for running a SUR in a panel data with year and industry fixed effects ?
            Thanks

            Comment


            • #7
              I have a similar question: It seems so natural, that SUR exists for random effects (XTSUR) but not for fixed effects estimators - I am sure there is an obvious explanation for that, but I am missing it.
              Paul T. Seed's post above shows that standard errors are not reliable when using dummies for controlling for fixed effects in combination with SUREG. Is there a way around? I am asking this because the random effects assumption of no correlation between the errors (including the "random effect") and the explanatory variables is rather strong and a common critique that is hard to disprove.

              Many thanks!

              Comment


              • #8
                Ahmed,

                I see above posts are a bit old and your issue is solved by now, I hope. I am posting the following just in case someone faces the same issue and finds this post as a result of her/his search.

                One way you can run XT commands for a system of equations is to follow the steps explained here:
                Blackwell, J. Lloyd (2005) "Estimation and testing of fixed-effect panel-data systems" The Stata Journal 5, Number 2, pp. 202-207

                Another command that works with the new data setup is XTMIXED which you may find more info about here:
                Marchenko, Yulia (2006) "Estimating variance components in Stata" The Stata Journal 6, Number 1, pp. 1-21

                Hope you find them helpful.

                Comment


                • #9
                  Hi Amir
                  Actually, I saw the first paper you mentioned but was not sure how to apply this in Stata for a 5X5 system of equations using sureg?
                  if you have any thoughts , will be glad to hear from you.
                  Thanks

                  Comment


                  • #10
                    Hello, actually I've tried xtsur right now and it seems that the problem is still there.

                    Comment


                    • #11
                      Hi Paul, I have a question to your following statement from above "Which ever method you choose, you can fit similar fixed effects models. xtsur (y x1 x2 x3 i.yr ) (z x2 x3 x4 i.yr ),corr
                      (Produces a valid answer)". Namely, I am working with a panel and using xtsur. However, I can't find a way how to run xtsur with fixed effects option. Stata won't allow any options like ", corr" and ", fe" at the end of the regression command and runs automatically random effects. I would appreciate if you could provide any cues with respect to this problem. Best regards!

                      Comment


                      • #12
                        Originally posted by Paolo Zanghieri View Post
                        Hello, actually I've tried xtsur right now and it seems that the problem is still there.

                        Hello Paolo,

                        You have to clear old mata saved results before re-running xtsur. Include 'cap clear mata' before xtsur.

                        Comment


                        • #13
                          On a related note I hope someone may help me in a problem I am having with xtsur or this may simply be an econometric issue. I don't mean to high jack this thread but figured it will be a useful place to post since everyone here seems to be using xtsur.

                          I am running xtsur as follows :

                          #delimit ;
                          xtsur (y1 x1 x1squared x2 x3 x4 x2squared x3squared x4squared x2*x3 x2*x4 x3*x4)
                          (y2 x2 x3 x4 x5)
                          (y3 x2 x3 x4 x5)
                          (y3 x2 x3 x4 x5);
                          #delimit cr

                          Doing a one-step and multi-step algorithm, STATA says calculating multi-step estimates, but pretty much does that forever.

                          I suspect it doesn't converge and is doing iterations after iterations constantly.

                          I am essentially estimating a derived demand system. Equation (1) is a cost function, equation (2) - (4) are share of cost equations.

                          Any help would be great, Thanks!

                          Comment


                          • #14
                            I know this post is old, but I am facing the same issue reported by Stein Monteiro.

                            I am running the following model:

                            Code:
                            xtsur (Ce_p price_cap cost_plus Q K Q_2 K_2 K_Q e_p w_p e_p_2 w_p_2 e_p_w_p e_p_Q e_p_K w_p_Q w_p_K)(share_de_e share_de_p share_de_w = e_p K_p w_p)
                            However, Stata keeps running the model forever.

                            Comment


                            • #15
                              I have just solved it by myself. The code is right but it was not running because I had too many observations.

                              Comment

                              Working...
                              X