Announcement

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

  • What does "...,i() fe" mean in Xtreg

    I read online examples,

    xtreg Y X, i(id) fe

    is equal to

    areg Y X, absorb(id)



    what does i(id) mean in xtreg??? Is it equal to xtreg Y X i.id, fe???


    The maunal for xtreg from stata doesn't mention it


    Thanks




  • #2
    get it. It defines the fixed effects with variables, for example ID.

    Comment


    • #3
      Originally posted by Shi Y. Yan View Post
      get it. It defines the fixed effects with variables, for example ID.
      Hi! I am wondering the same, and wanted to ask if you figured out if this is indeed the same as i.id?

      Comment


      • #4
        Please read -xtreg- entry in Stata .PDF manual.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Your thinking seems to be correct, although note the syntax you are using is confusing.

          The fixed effect option is equal to including dummies for the id variable used in xtset.
          In Stata this would be written as xtreg Y X i.id
          Which is equal to xtreg Y X, fe
          Doing xtreg Y X i.id, fe would be doing the same thing twice.
          See also the example data below

          Note that you could have a situation where xtreg Y X i.z, fe is useful, for instance for companies (the id used in xtset) located in different countries (which you could use in the z variable)


          Code:
          webuse grunfeld, clear
          xtset company year
          xtreg invest mvalue kstock time i.company, re
          xtreg invest mvalue kstock time, fe
          xtreg invest mvalue kstock time i.company, fe

          Comment


          • #6
            Carlo, I've searched the manuals and all over the Internet and still can't figure what is the difference between i.var and i(var) option.

            Jorrit, maybe you can advise whether

            xtreg Y X i.z, fe

            is the same as

            xtreg Y X, i(z) fe

            ?

            Comment


            • #7
              No. This is somewhat confusing and difficult to type up succinctly, but there are different ways of i being used here.

              in any xt command, Stata demands that you tell it what variable identifies groups. You can do that with xtset (id) (or xtset(id year)), which will set the id variable for everything you do afterwards.
              You can also specify this group variable for individual regression, by doing e.g. xtreg Y X, i(id) fe.

              Code:
              xtset id
              xtreg Y X, fe
              is exactly equal to

              Code:
              xtreg Y X, i(id) fe

              So: the use of i(id) is to identify groups.

              This is separate from including these groups as dummy variables in your regression, which you would do with i.id:
              xtreg Y X i.id which is equal to xtreg Y X i.id, re as random effects is the standard in Stata, and is also equal to doing the fixed effects version as xtreg Y X, fe .
              However, there is no point to doing xtreg Y X i.id, fe as fixed effects already includes dummies for the id variable.

              You can include i.z in your xtreg, fe if you have another category, other than the id variable, for which you want to include fixed effects.
              That is xtreg Y X i.z, fe which is equal to xtreg Y X i.id i.z, re

              Comment


              • #8
                Probably a better advice: forget i(id).
                Stata wants to hear the panel and time variable using xtset before you do xt commands The use of telling Stata about panel variable with i(id) is essentially an older version of the same, see the technical note on p4 of the xtset manual: http://www.stata.com/manuals13/xtxtset.pdf#xtxtset

                Perhaps the confusion as created here was an argument to stop listing the i(id) option?

                Comment


                • #9
                  Jorrit, thanks a lot for the detailed answers, everything is clear now, I am using xtset, so I will skip the i(id) option.

                  Comment

                  Working...
                  X