Hello,
I conducting a Poisson regression using panel data and want to graph using MARGINSPLOT the effects of a 3-way interaction on a count outcome. My plot indicates negative predicted outcomes and I suspect that this occurs since the default prediction from GMM is the linear prediction (xb). What I want on the y-axis are predicted counts (not the linear prediction). If I were using POISSON, I know I could specify a predict(n) option in MARGINS. I'm unsure, however, what to do after GMM and could use some help.
My simplified code is the following:
gmm (f.numdrug - exp({xb: stockgap c.rdint c.fdi3##c.simvar##c.numdrug3 totalli lnlocus5 size init }+{b0})) , ///
instruments( `inst2' stockgap c.rdint c.fdi3##c.simvar##c.numdrug3 totalli lnlocus5 size init , cons ) twostep vce(cluster firm )
(note this model is overidentified by including additional instruments included in `inst2')
quietly margins, at(fdi3=(278148(300000)1497133) simvar=(0 .7) numdrug3=(0 3) ) atmeans predict(norm(xb()))
marginsplot, plot1opts(lpattern(dash) lwidth(thick)) plot2opts(lpattern(longdash) lwidth(thick)) ///
noci title("c.simchange1##c.fdi3#numdrug3 ") name(fdidrug3, replace) graphregion(fcolor(white)) xtitle("fdi3") ytitle("numdrug" )
Does anyone have suggestions on how to plot predicted counts after GMM?
Thanks in advance,
Ed
I conducting a Poisson regression using panel data and want to graph using MARGINSPLOT the effects of a 3-way interaction on a count outcome. My plot indicates negative predicted outcomes and I suspect that this occurs since the default prediction from GMM is the linear prediction (xb). What I want on the y-axis are predicted counts (not the linear prediction). If I were using POISSON, I know I could specify a predict(n) option in MARGINS. I'm unsure, however, what to do after GMM and could use some help.
My simplified code is the following:
gmm (f.numdrug - exp({xb: stockgap c.rdint c.fdi3##c.simvar##c.numdrug3 totalli lnlocus5 size init }+{b0})) , ///
instruments( `inst2' stockgap c.rdint c.fdi3##c.simvar##c.numdrug3 totalli lnlocus5 size init , cons ) twostep vce(cluster firm )
(note this model is overidentified by including additional instruments included in `inst2')
quietly margins, at(fdi3=(278148(300000)1497133) simvar=(0 .7) numdrug3=(0 3) ) atmeans predict(norm(xb()))
marginsplot, plot1opts(lpattern(dash) lwidth(thick)) plot2opts(lpattern(longdash) lwidth(thick)) ///
noci title("c.simchange1##c.fdi3#numdrug3 ") name(fdidrug3, replace) graphregion(fcolor(white)) xtitle("fdi3") ytitle("numdrug" )
Does anyone have suggestions on how to plot predicted counts after GMM?
Thanks in advance,
Ed
Comment