Announcement

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

  • How can I include the coefficents for my baseline interaction?

    Hello,

    I am doing an linear probabilty regression and want to incude the coeffficents for the baseline (in this case educational level 3) in my outputtable. What I am basically testing is the effect of a treatment on health - but as I expect heterogeneous effects for different educational levels I need to check the interactions. When I do so I get the results for my treatment#educational levels 2 & 1 (as a comparison to educational level 3). For educational level 3 I get 0 & (.). I would like to also include the results for treatment#educational level 3 - is that possible? Basically the Idea is to say: the treatment with educational level 1 leads to x level of diseases. When educational level rises to educational level 2, the treatment leads to an additional x% increase in health ans so on.

    The code:
    regress health treat##ib3.education $controls, vce(cluster clusterlevel)
    est sto est_health_01

    Thanks in advance.

  • #2
    Not sure wheter I solved it correctley but I came up with the following solution:

    regress health 1.treat##3.education 2.treat##3.education treat##ib3.education $controls, vce(cluster clusterlevel)
    est sto est_health_01

    --> Now the ommitted interactions between my treatment 1 and eductaional level 3 and my treatment 2 and educational level 3 are included.

    Comment


    • #3
      Soj:
      to protect your resulst from the dummy trap (Dummy variable (statistics) - Wikipedia), Stata omits level(s) of categorical variable(s) (and unavoidably so).
      The good news is that you can decide what to leave in via the -fvvarlist- options.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Thanks!
        Last edited by Soj Karimi; 23 May 2023, 08:28.

        Comment


        • #5
          Originally posted by Carlo Lazzaro View Post
          Soj:
          to protect your resulst from the dummy trap (Dummy variable (statistics) - Wikipedia), Stata omits level(s) of categorical variable(s) (and unavoidably so).
          The good news is that you can decide what to leave in via the -fvvarlist- options.
          Dear Carlo,

          thanks a lot for the response! Unfortunatley my solution frome above does not work. Due to colinearity many variables are ommitted. After discovering thatI tried the fvvarlist option: ibn. with the noconstant option to deal with colinearity. Still it doenst work for the interactions. Do you happen to know a soultion for that?

          Right now i have this code:
          regress health treat##ibn.education $controls, vce(cluster clusterlevel)
          est sto est_health_01

          --> Using that code all coefficents for education level 1,2, & 3 are shown. BUT the interactions for educational level 3 are still omitted.

          meaning I want to heave:
          treat1 x educ 1
          treat1 x educ 2
          treat1 x educ 3

          treat2 x educ 1
          treat2 x educ 2
          treat2 x educ3

          BUT I get
          treat1 x educ 1
          treat1 x educ 2
          OMITTED

          treat2 x educ 1
          treat2 x educ 2
          OMITTED

          Can someone help?

          Best,
          Soj

          Comment


          • #6
            Hello,

            i think I figured it out. The problem was the double ##

            Using soley one # solves the problem.

            regress health treat#ibn.education $controls, vce(cluster clusterlevel)

            Best,
            Soj

            Comment


            • #7
              Soj:
              yes, but it's hardly what you probably want.
              Interaction without the main conditional terms (-treat- and -education-, in your case) are rarely used.
              In your case, they do not fix your problem, but simply code something different.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment

              Working...
              X