Announcement

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

  • Margins Plot after Logistic Regression with Interaction

    Hi there,

    I am experiencing something strange and I am coming here to seek for advice. When I run the following code, I successfully get a plot of the margins:
    logit timemammog i.immig##i.white ///
    age children citizenship english yrsimmig married ///
    education income area ///
    healthstat insurance ///
    if age>=45 & age<=75 ///
    [pw=perweight], or

    margins, at(immig=(0 1) white=(0 1))
    marginsplot, title("Time for mammogram: Interaction between immigrant and white", span size(small))
    graph export "$graph/Time for mammogram.pdf", replace

    However, my variables yrsimmig and area are categorical, so when I add i. in front of each, the plots no longer work. Any ideas?

    This is the slightly changed code:
    logit timemammog i.immig##i.white ///
    age children citizenship english i.yrsimmig married ///
    education income i.area ///
    healthstat insurance ///
    if age>=45 & age<=75 ///
    [pw=perweight], or

    margins, at(immig=(0 1) white=(0 1))
    marginsplot, title("Time for mammogram: Interaction between immigrant and white", span size(small))
    graph export "$graph/Time for mammogram.pdf", replace

  • #2
    What do you mean with "the plots no longer work"
    That is a very vague explanation of what you see, that other people cannot.

    Perhaps it would help if you can come up with a reproducible example?

    Comment

    Working...
    X