Announcement

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

  • Fixed Effects and LSDV

    Below u can find my results from different regressions.
    Shouldn't my results using the fixed effects estimator and the LSDV estimator be the same? Why does the magnitude of the coefficients change? I regress the same model
    One with FE like this:
    Code:
    xi: xtreg lnx lnigdp lnjgdp lnigdpcap lnjgdpcap lndistcap lnicpi lnjcpi comlang_off contig comlang_ethno colony comcol fta lniopen lnjopen i.ye i.exp i.imp i.commodity_code, fe vce (robust)
    And one with LSDV:
    Code:
    xi: reg lnx lnigdp lnjgdp lnigdpcap lnjgdpcap lndistcap lnicpi lnjcpi comlang_off contig comlang_ethno colony comcol fta lniopen lnjopen i.ye i.exp i.imp i.commodity_code, r
    Click image for larger version

Name:	2018-12-04.png
Views:	1
Size:	61.9 KB
ID:	1473359

  • #2
    And what is your

    xtset panelvar timevar

    ?

    Comment


    • #3
      Hi Lazaros
      It seems to me that your xtreg is including "MORE" fixed effects that you are not considering in your LSDV model. At least based on the command lines that you are showing, they are exactly the same expect for the FE option of the xtreg.
      In other words, you are controlling for MORE things in your xtreg regression compared to the LSDV regression.
      Fernando

      Comment


      • #4
        So yes my mistake for that Fernando, my FE model is like this
        Code:
        xi: xtreg lnx lnigdp lnjgdp lnigdpcap lnjgdpcap lndistcap lnicpi lnjcpi comlang_off contig comlang_ethno colony comcol fta lniopen lnjopen i.ye , fe vce (robust)
        So, my hausman test does indeed dictat5e fixed (between fixed and random) but distance is omitted (seems logic since its time invariant). I perform lsdv for this reason because I want distance to have a coefficient.
        My xtset includes: As cross section I have the variable I wich is a group of commodities importers and exporters and my time variable is years (2005-16)

        Comment


        • #5
          The term LSDV (least squares dummy variable [estimator]) usually refers to a (linear) model that includes indicator (so-called "dummy") variables for each panel-unit. The LSDV cannot produce estimates for predictors that do not vary within panel-units because the latter are collinear with the indicator variables. When you say

          [...] distance is omitted (seems logic since its time invariant). I perform lsdv for this reason because I want distance to have a coefficient.
          you either do not fully understand what the LSDV does and/or use a different definition of that term. Either way, done properly, the coefficients form the LSDV and those from the fixed-effects (within) estimator are identical (in linear models). If you want coefficients for predictors that are constant within panel-units, you need a random-effects model that estimates such coefficients from the between panel-unit variances alone.

          Concerning syntax, It is hard to tell what exactly is wrong here since you did not present your xtset command. When you

          Code:
          xtset id year
          the (proper) LSDV has to be

          Code:
          regress ... i.id
          Also unless you are using an ancient version of Stata, get rid of the xi prefix; it is not needed and potentially dangerous.

          Best
          Daniel

          Comment


          • #6
            Originally posted by daniel klein View Post
            The term LSDV (least squares dummy variable [estimator]) usually refers to a (linear) model that includes indicator (so-called "dummy") variables for each panel-unit. The LSDV cannot produce estimates for predictors that do not vary within panel-units because the latter are collinear with the indicator variables. When you say



            you either do not fully understand what the LSDV does and/or use a different definition of that term. Either way, done properly, the coefficients form the LSDV and those from the fixed-effects (within) estimator are identical (in linear models). If you want coefficients for predictors that are constant within panel-units, you need a random-effects model that estimates such coefficients from the between panel-unit variances alone.

            Concerning syntax, It is hard to tell what exactly is wrong here since you did not present your xtset command. When you

            Code:
            xtset id year
            the (proper) LSDV has to be

            Code:
            regress ... i.id
            Also unless you are using an ancient version of Stata, get rid of the xi prefix; it is not needed and potentially dangerous.

            Best
            Daniel
            Thank you so much for helping/ To start with. I do understand in a level what LSDV does but as you can see from my results it does not omit distance which is time invariant. Second, I cannot simply reg with i.id because id contains so many data that its coefficient matrix cannot be inverted in the regression process.
            Here is my code for forming the xtset:

            Code:
            egen ye    = group(year)
            egen exp   = group(exporter)
            egen imp   = group(importer)
            egen exp_t = group(exporter year)
            egen imp_t = group(importer year)
            egen i     = group(exporter importer commodity_code)
            xtset i year

            Comment


            • #7
              Originally posted by Lazaros Antonios Chatzilazarou View Post
              as you can see from my results
              Please post the actual output that you get from Stata (using code delimiters) not some screenshot (which I find hard to read), see also FAQ #12 on this.

              Originally posted by Lazaros Antonios Chatzilazarou View Post
              [...] it does not omit distance which is time invariant.
              If distance does not vary within i (i.e., your panel-units), you cannot obtain a coefficient for it; the exception is that Stata might omit more than one panel-unit, in which case the coefficient for distance actually represents the panel-unit (fixed) effect for the omitted panel-unit (i.e., the difference to the reference). Whether distance varies over time or not is of second importance; variation over time might or might not coincide with variation within panel-units; the latter is cruical.

              Unfortunately, I have a very hard time following your code. Why do you group() one variable, as you do repeatedly here:

              Code:
              egen ye = group(year)
              egen exp = group(exporter)
              egen imp = group(importer)
              Also, none of the following variables seem to appear anywhere else in the code; neither in the xtset nor the models that you show.

              Code:
              egen exp_t = group(exporter year)
              egen imp_t = group(importer year)
              Why do you do the above?

              Code:
              egen i = group(exporter importer commodity_code)
              xtset i year
              If you did this, then you need i.i in your regress command to obtain the LSDV (as usually defined). Oftentimes, this model is indeed not feasible with Stata. You may want to have a look at areg (although the latter assumes that the panel-units represent the population not a sample). If you chose to estimate a different model, you should not expect the results to match the fixed-effects estimator.

              However, I fail to see the point of estimating the LSDV in the first place, when you (rightfully) expect the results to be identical to those from the fixed-effects model anyway. Given your earlier statement about wanting coefficients for predictors that are omitted in the FE model because they are constant within panel-units, I repeat that the LSDV is the not the appropriate tool.

              Best
              Daniel
              Last edited by daniel klein; 05 Dec 2018, 07:14. Reason: lots of spelling

              Comment

              Working...
              X