Announcement

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

  • Visualizing interactions with twoway contour

    Hi!

    I would love to get some help with how to visualize my interaction. I have been using this stata manual of twoway contour (https://www.stata.com/stata-news/news32-1/spotlight/). But the problem is that my graph does not show any curvature but only straight lines, making me wonder if it does not show the interaction (see picture). I use an education variable with six levels, and an income variable with 12. Can't see why my graph would differ. There is a significant interaction term. Happy for any advice!




    Click image for larger version

Name:	Skärmavbild 2022-11-21 kl. 13.34.55.png
Views:	2
Size:	253.4 KB
ID:	1690300


    reg outcomevar income education c.education#c.income
    quietly margins, at(education=(1(1)6) income=(1(1)12)) saving(predictions, replace)

    use predictions, clear
    list _at1 _at2 _margin in 1/5

    rename _at1 education
    rename _at2 income
    rename _margin pr_outcomevar

    *reg outcome c.education##c.income
    twoway contour pr_outcomevar income education, ccuts(0(0.2)5.0)),
    xlabel(1(1)6)
    ylabel(0(1)12, angle(horizontal))
    xtitle("Education (categories)")
    ytitle("Income")




    Best,
    Marcus



  • #2
    Hard to say without the data. Maybe your interaction term is statistically significant,but substantively zero. Maybe, the data is not what you think it is.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment

    Working...
    X