Announcement

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

  • Ivreg 2sls and fixed effects

    Dear all,
    I would like to use instrument2 as an instrument for sp_city_10t.
    I estimate the following regression and the regression table includes all the year and other fixed effects as additional instruments for sp_city even though I only specify instrument2.
    What might be the reason?


    ivregress 2sls `var' i.year i.il_kodu (sp_city_10t=instrument2) , robust

    Instrumental variables (2SLS) regression Number of obs = 247799
    Wald chi2(90) =10271.28
    Prob > chi2 = 0.0000
    R-squared = 0.0151
    Root MSE = .08672

    ------------------------------------------------------------------------------
    | Robust
    relsales | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    sp_city_10t | -.0000711 .0000434 -1.64 0.102 -.0001562 .0000141
    |
    year |
    2007 | .001895 .0009753 1.94 0.052 -.0000165 .0038064
    2008 | -.000938 .0009446 -0.99 0.321 -.0027894 .0009134
    2009 | .0075193 .0010504 7.16 0.000 .0054605 .0095781
    2010 | -.0008531 .0009168 -0.93 0.352 -.00265 .0009438
    2011 | -.0078511 .0008569 -9.16 0.000 -.0095307 -.0061715
    2012 | -.0101156 .0008275 -12.22 0.000 -.0117376 -.0084937
    2013 | -.0128642 .0008114 -15.85 0.000 -.0144545 -.0112739
    2014 | -.0109149 .0010367 -10.53 0.000 -.0129468 -.0088831
    2015 | -.0115138 .0011046 -10.42 0.000 -.0136789 -.0093487
    |
    il_kodu |
    2 | -.0130217 .0027672 -4.71 0.000 -.0184453 -.0075981

    81 | .0042069 .0035961 1.17 0.242 -.0028413 .0112551
    |
    _cons | .0451145 .0013347 33.80 0.000 .0424985 .0477304
    ------------------------------------------------------------------------------
    Instrumented: sp_city_10t
    Instruments: 2007.year 2008.year 2009.year 2010.year 2011.year 2012.year
    2013.year 2014.year 2015.year 2.il_kodu 3.il_kodu 4.il_kodu
    5.il_kodu 6.il_kodu 7.il_kodu 8.il_kodu 9.il_kodu 10.il_kodu
    11.il_kodu 12.il_kodu 13.il_kodu 14.il_kodu 15.il_kodu
    16.il_kodu 17.il_kodu 18.il_kodu 19.il_kodu 20.il_kodu
    21.il_kodu 22.il_kodu 23.il_kodu 24.il_kodu 25.il_kodu
    26.il_kodu 27.il_kodu 28.il_kodu 29.il_kodu 30.il_kodu
    31.il_kodu 32.il_kodu 33.il_kodu 34.il_kodu 35.il_kodu
    36.il_kodu 37.il_kodu 38.il_kodu 39.il_kodu 40.il_kodu
    41.il_kodu 42.il_kodu 43.il_kodu 44.il_kodu 45.il_kodu
    46.il_kodu 47.il_kodu 48.il_kodu 49.il_kodu 50.il_kodu
    51.il_kodu 52.il_kodu 53.il_kodu 54.il_kodu 55.il_kodu
    56.il_kodu 57.il_kodu 58.il_kodu 59.il_kodu 60.il_kodu
    61.il_kodu 62.il_kodu 63.il_kodu 64.il_kodu 65.il_kodu
    66.il_kodu 67.il_kodu 68.il_kodu 69.il_kodu 70.il_kodu
    71.il_kodu 72.il_kodu 73.il_kodu 74.il_kodu 75.il_kodu
    76.il_kodu 77.il_kodu 78.il_kodu 79.il_kodu 80.il_kodu
    81.il_kodu instrument2

    relsales_iv.xls
    dir : seeout








  • #2
    You’re using 2SLS. All exogenous variables properly appear in the first stage (reduced form) for your endogenous explanatory variable. Any variable acting as a control should appear in the first stage. This is relevant for checking whether you have a strong enough instrument.

    JW

    Comment


    • #3
      BTW, you’d be better off using xtivreg and clustering your standard errors at the id_kodu level.

      Comment


      • #4
        Thanks Prof. Wooldridge.
        My data is at firm level(id)
        However in the above regression, I have only included year and city fixed effects (i.il_kodu). Note that my instrument is at city level and my data is at firm level
        Should I use xtivreg and cluster standar errors at the firm level?
        xtset id year
        xtivreg `var' i.year i.il_kodu (sp_city_10t=instrument2) , fe vce(cluster id)

        Comment


        • #5
          I apologize — I didn’t read your output carefully. With your IV being at the city level, there’s a case to be made for clustering at the city level. How many cities do you have?

          Comment


          • #6
            I have 81 cities

            Comment


            • #7
              That’s enough. Try clustering at least at the firm level, then at the city level.

              Comment


              • #8
                Thank you very much. For clustering at firm level, we allow " intragroup correlation for standard errors, relaxing the usual requirement that the observations be
                independent. That is to say, the observations are independent across groups (clusters) but not necessarily within groups."
                I have been using "vce(cluster id)" along with xtivreg command however it does not allow me to use cluster option. Is there any other way for clustering at the firm level?

                xtset id year
                xtivreg `var' i.year i.il_kodu (sp_city_10t=instrument2) , fe vce(cluster id)

                Comment


                • #9
                  Which version of Stata are you using? The vce(cluster id) option started in Stata 14, I believe. The user-written command xtivreg2 allows clustering and can be installed with older versions of Stata.

                  Comment


                  • #10
                    I use STATA 13. Thank you!

                    Comment


                    • #11
                      Nazli:
                      time has come to upgrade your current Stata release.
                      Things are much easier with the most recent Stata versions (and econometric analyses can benefit from them, especially for panel data regressions).
                      Kind regards,
                      Carlo
                      (Stata 19.0)

                      Comment


                      • #12
                        You are right, for now I am expecting funds in order to be able to buy it. In the meantime trying to install the user written command xtivreg2 but couldn't figure out how to do that...

                        Comment


                        • #13
                          Nazli:
                          from -search xtivreg2- I got the following details:
                          Requires: Stata version 8.2 and ivreg2, ranktest from SSC
                          Kind regards,
                          Carlo
                          (Stata 19.0)

                          Comment


                          • #14
                            When in Stata type the following commands:
                            ssc install ivreg2
                            ssc install ranktest
                            ssc install xtivreg2

                            Comment


                            • #15
                              Thank you! I am working with confidential data and I do not have internet access. I have downloaded these files (bunch of files with ado, hlp, mlib, sthlp extensions) using a computer with internet access. Then, I have pasted them under ado folder in STATA13 under related subfolders (x, l, i, r) . I am having the following error:

                              struct ms_vcvorthog undefined
                              817 lines unskipped
                              factor variables are undefined
                              r(101)

                              Comment

                              Working...
                              X