Announcement

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

  • Plotting coefficients using Marginsplot

    Dear Users,

    This is a repost as I believe in my previous post I did not clarify exactly what I wanted.

    I have a panel dataset at investor-bid level. I want to check if there is a nonlinear relationship between PercentAutoBid and Man2Auto. I then test for this using the nlcom command. Based on the nlcom command and the marginsplot it shows the nonlinearity between the two variables.

    Code:
        g PercentAutoBid_2 = PercentAutoBid*PercentAutoBid
        g inter2 = sharpe_ratio*PercentAutoBid
        g inter3 = sharpe_ratio*PercentAutoBid_2
    
        eststo: reghdfe Man2Auto l.sharpe_ratio l.PercentAutoBid l.c.PercentAutoBid#l.c.PercentAutoBid ///
            l.inter2 l.inter3, a(LenderId hour LoanId) cluster(interaction)
                estadd local LenderId "Yes", replace
                estadd local hour "Yes", replace
                estadd local LoanId "Yes", replace
        est store AutoSwitching
    
        nlcom -_b[l.PercentAutoBid]/(2*_b[l.c.PercentAutoBid#l.c.PercentAutoBid])
    
        margins, at(l.PercentAutoBid = (0(0.1)1))
        marginsplot, /*
        */ plot1opts(lc(black) lp(longdash_dot)) ciopt(color(black)) plotopts(mcolor("black")) /*
        */ xline(.786, lstyle(grid) lp(longdash_dot) lc(maroon)) xti("Lag (Share Auto Bidding)") /*
        */ text(0.04 0.77 "Turning Point at 0.786", place(s) orient(vertical) color(black) size(small)) /*
        */ yti("Pr(Switch to Automatic = 1)") title("Panel B: Switching to Automatic") /*
        */ name(plot1, replace)
    I want to add extra coefficients to my plot which are the l.sharpe_ratio coefficients (from the regression). These coefficients I want to plot them at different Lag Share Auto Bidding Levels (PercentAutoBid).

    Is this possible using a marginsplot? Using addplot did not work I want the coefficients from the regression itself.

    Best
    Attached Files
    Last edited by Said Kaawach; 17 Oct 2022, 10:00.

  • #2
    The earlier topic is at

    https://www.statalist.org/forums/for...ng-marginsplot

    Comment


    • #3
      Originally posted by Said Kaawach View Post

      I want to add extra coefficients to my plot which are the l.sharpe_ratio coefficients (from the regression). These coefficients I want to plot them at different Lag Share Auto Bidding Levels (PercentAutoBid).

      Best
      I find it hard to follow this. Coefficients from what regression? Show us the regression and tell us how you match a particular lag of share auto bidding to a particular coefficient. I do not think the problem is one of method here, but your description is too vague to decipher.

      Comment

      Working...
      X