Announcement

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

  • Choosing reference category (omitted varible) by myself when doing xtreg with panel data

    I would like to chose by myself the reference category in dummy coding instead of a default category that Stata choses arbitrary (last alphabetically).

    In other words,I am running an xtreg on panel data and Stata choses as reference the last alphabetically variable (that then appears as omitted in the table of results). I would like to chose by myself the omitted variable so that interpretation of results be easier.

    Illustration:
    My command is <xtreg q6_ Isetting1-Isetting18 , re> and Stata choses Isetting18 as reference category.
    How could I, for instance, chose Isetting3 as reference category?

    Thanks.


  • #2
    how about
    Code:
    xtreg q6_ Isetting1 Isetting2 Isetting4-Isetting18 , re>

    Comment


    • #3
      Congratulation Rich, it works! Thanks a lot.

      Comment


      • #4
        You created the dummies yourself? If so, using factor variable notation is easier, e.g.

        xtreg y ib3.x, re

        see help fvvarlist
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        StataNow Version: 19.5 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          Yes I created the dummies myself but I do not manage to code your proposal; when I code
          <xtreg q6_ ib3.Eff_Isetting1-Eff_Isetting18>
          then Stata gives an error message that I do not understand: "Eff_Isetting1: factor variables may not contain negative values"

          If you can help me in interpretating this error message, that would help since same message appears when I want to do interactions with socio-economic characteristics for instance.

          Comment


          • #6
            Again, look at the help for fvvarlist. You don’t want to use the dummy vars you created. You want the original categorical variable. Also this might be helpful.

            https://www3.nd.edu/~rwilliam/xsoc73994/Margins01.pdf
            -------------------------------------------
            Richard Williams, Notre Dame Dept of Sociology
            StataNow Version: 19.5 MP (2 processor)

            EMAIL: [email protected]
            WWW: https://www3.nd.edu/~rwilliam

            Comment

            Working...
            X