Announcement

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

  • Margins plot using 25th and 75th quantile interaction

    Hello,

    I would like to find the continuous variables interaction plot using -margins- and -marginsplot- command.

    (p25) specifies the 25th quantile observation of a variable. (p75) specifies the 75th quantile observation of a variable.

    Should I do something like
    margins, at(X=((p25) (p75)) Y=((p25) (p75)))

    What I did is just find the p25 and p75 value of X, Y variable respectively. And put them in the margins, at(X = (0.25 0.75) Y=(0.25 0.75))
    Do I do it right? Is there any other way to do this?

  • #2
    Here is how I would do this:

    Code:
    sysuse nlsw88, clear
    logit union c.wage##c.hours i.south i.race
    _pctile wage if e(sample), perc(10 25 50 75 90)
    local w10 = r(r1)
    local w25 = r(r2)
    local w50 = r(r3)
    local w75 = r(r4)
    local w90 = r(r5)
    
    margins , at(wage=(`w10' `w25' `w50' `w75' `w90') hours=(1/80) south=0 race=1)
    marginsplot, xdim(hours) noci
    You might also be interested in http://www.maartenbuis.nl/wp/inter_q...ter_quadr.html
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment

    Working...
    X