Announcement

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

  • lincom with three way interactions

    Hi all,
    I am analyzing the effect of the pandemic on health behaviours comparing women and men and would like to get a better understanding of heterogeneity. For example, in the equation below, I would like to compare the outcomes for low income women vs. high income women before and after the pandemic to see whether the effects are different by income groups. I would like to use lincom to get the relevant coefficient and the associated standard errors and confidence intervals. The coefficient I'm getting is quite large (after converting to a probability) and was wondering if I had the right lincom specification?

    global controls_simp i.agecat_sec i.educ_ref i.race_main i.jbstat_ref i.cathhincome_ref i.mhvalue_ref_casenessc i.marstat_ref i.nchild015_ref c.hhsize_ref ///
    i.gor_main i.imonth_final

    xtreg dfruit_simp i.treatfem##i.July2020##i.cathhincome_refb $controls_simp, fe vce(cluster pidp)
    lincom 1.treatfem + 1.treatfem#1.July2020 + 1.treatfem#1.cathhincome_refb + 1.cathhincome_refb#1.July2020 + 1.treatfem#1.July2020#1.cathhincome_refb, or

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input long pidp float(dfruit_simp treatfem July2020 cathhincome_refb agecat_sec educ_ref race_main jbstat_ref cathhincome_ref mhvalue_ref_casenessc marstat_ref nchild015_ref hhsize_ref gor_main imonth_final)
       76165 1 1 0 1 0 . 1 1 3 0 1 1 3  5  4
       76165 . 1 . 1 1 . 1 1 3 0 1 1 3  5  9
       76165 . 1 . 1 1 . 1 1 3 0 1 1 3  5  3
       76165 . 1 . 1 1 . 1 1 3 0 1 1 3  5 11
       76165 1 1 . 1 1 . 1 1 3 0 1 1 3  5  1
       76165 1 1 1 1 1 . 1 1 3 0 1 1 3  5  7
     1587125 1 1 . 1 2 . 0 1 2 0 0 0 2  1  1
     1587125 . 1 . 1 2 . 0 1 2 0 0 0 2  1  9
     1587125 . 1 . 1 2 . 0 1 2 0 0 0 2  1  3
     1587125 1 1 0 1 2 . 0 1 2 0 0 0 2  1  9
     1587125 . 1 . 1 2 . 0 1 2 0 0 0 2  1 11
     1587125 0 1 1 1 2 . 0 1 2 0 0 0 2  1  7
     4849085 1 0 . 1 1 1 1 1 3 1 1 0 3 11  1
     4849085 . 0 . 1 1 1 1 1 3 1 1 0 3 11  9
     4849085 . 0 . 1 1 1 1 1 3 1 1 0 3 11  3
     4849085 . 0 . . 1 1 1 1 . 1 1 0 3 11 11
     4849085 0 0 0 1 0 1 1 1 3 1 1 0 3 11  4
     4849085 1 0 1 1 1 1 1 1 3 1 1 0 3 11  7
    68002725 0 1 . 0 3 . 0 4 1 0 0 0 1  7  1
    68002725 . 1 . 0 3 . 0 4 1 0 0 0 1  7  9
    68002725 0 1 0 0 2 . 0 4 1 0 0 0 1  7  3
    68002725 . 1 . 0 3 . 0 4 1 0 0 0 1  7  3
    68002725 0 1 1 0 3 . 0 4 1 0 0 0 1  7  7
    68002725 . 1 . 0 3 . 0 4 1 0 0 0 1  7 11
    68008847 0 1 . . 2 0 1 1 . 0 0 0 1  1  1
    end
    Many thanks
    Karen

  • #2
    Karen:
    set aside for a while my idiosyncrasy for any >2-term interaction (too difficult to disseminate), I would have coded something like_
    Code:
    lincom 1.treatfem + 1.July2020 +1.cathhincome_refb + 1.treatfem#1.July2020 + 1.treatfem#1.cathhincome_refb + 1.cathhincome_refb#1.July2020 + 1.treatfem#1.July2020#1.cathhincome_refb, or
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thanks Carlo Lazzaro, appreciate that.

      Many thanks
      Karen

      Comment

      Working...
      X