Announcement

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

  • How can I read a three-way # interaction with dummies and a "constant"?

    Hi,

    I was wondering how I could read a three-way interaction with one #, two dummies (0,1) and a "constant"? There are a lot of documents for regressions with ## interactions but I have found none for #. I have the following regression:
    xi: areg trans i.classage#i.group1#c.school, absorb(urban)
    | Robust
    transanmoy | Coef. Std. Err. t P>|t| [95% Conf. Interval]
    -----------------------------------------------------+----------------------------------------------------------------
    I_nbre_classe11_2plus#I_bp# |
    c.tot_scol_prim1 |
    0 0 | 95304.22 345818 0.28 0.784 -593307.5 783915.9
    0 1 | 136654.4 183444.6 0.74 0.459 -228630.4 501939.2
    1 0 | 24511.88 380467.3 0.06 0.949 -733095.2 782119
    1 1 | -89434.71 115478.5 -0.77 0.441 -319381.8 140512.3

    I thought each coefficient corresponded to the regression of the "constant", c.school_rate, with my dependent variable for the combination of each subgroup (that is reg trans school if group==0 and classage==0 which gives the coefficient 95304.22 etc.) but as I took the opposite dummy for i.group I got a completely different result, which shouldn't be according to my understanding:


    | Robust
    transanmoy | Coef. Std. Err. t P>|t| [95% Conf. Interval]
    ----------------------------------------+----------------------------------------------------------------
    I_nbre_classe11_2plus#I_nobp# |
    c.tot_scol_prim1 |
    0 0 | 9053.467 280265.4 0.03 0.974 -548285 566391.9
    0 1 | -156647.6 253266.7 -0.62 0.538 -660296.2 347001
    1 0 | -250002 157739.8 -1.58 0.117 -563684.8 63680.83
    1 1 | -359902.2 477793.8 -0.75 0.453 -1310047 590243.1

    How is that? How do I interpret these results?

    Thank you very much,

    Alexandra

  • #2
    First off, don't use the xi: prefix. As to your question, see: http://maartenbuis.nl/publications/ref_cat.html



    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Maarten Buis : FYI, the webpage you link is empty.
      Stata/MP 14.1 (64-bit x86-64)
      Revision 19 May 2016
      Win 8.1

      Comment


      • #4
        The server appears to be down.
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment


        • #5
          Alexandra, Let's be sure we are speaking the same language here. Take a look at help fvvarlist which describes the operators # and ##.

          Code:
          i.classage#i.group1#c.school
          *expands to
          i.classage*i.group*c.school
          
          
          i.classage##i.group1##c.school
          *expands to
          i.classage + i.group + c.school + i.classage#i.group + i.classage#c.school + i.group#c.school + i.classage#i.group#c.school
          Unless you have a very good theoretical reason, you should include all constituent parts of interaction terms. Therefore, you should use the ## operator instead of the # operator.

          Please place the [CODE] [/CODE] around any Stata code or output. Your results in #1 are not readable.
          Stata/MP 14.1 (64-bit x86-64)
          Revision 19 May 2016
          Win 8.1

          Comment


          • #6
            Ah ok thanks a lot for your answers!

            Comment


            • #7
              [QUOTE=Carole J. Wilson;n1338758]
              Code:
              i.classage#i.group1#c.school
              *expands to
              i.classage*i.group*c.school
              That is not quite true. It makes all possible combinations of classage, group, and school. If you include the constant in your model, it will remove one of those as a reference category, otherwise it includes all of them. It gets a bit more complicated if you also manually include the main effects. So you can use this and get somewhat meaningful results. At least you won't run into the problem of including interactions without including the main effects.

              ---------------------------------
              Maarten L. Buis
              University of Konstanz
              Department of history and sociology
              box 40
              78457 Konstanz
              Germany
              http://www.maartenbuis.nl
              ---------------------------------

              Comment


              • #8
                Thanks for clarifying, Maarten.

                The actual expansion is:
                Code:
                classage0*group0*school +
                classage0*group1*school+
                classage1*group0*school+
                classage1*group1*school
                Even with a constant, it will give you coefficients for all.

                Code:
                clear
                sysuse auto
                gen tr=0
                replace tr=1 if trunk>=14
                reg price i.foreign#i.tr#c.rep78 , coefleg
                In this case, I guess you would interpret the constant as the value of yhat when the values of the factor variables are at the baseline and the continuous variable is 0 (which is not possible in this case)?

                Stata/MP 14.1 (64-bit x86-64)
                Revision 19 May 2016
                Win 8.1

                Comment

                Working...
                X