Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Re: Marginal effects after ivreg2

From   "Schaffer, Mark E" <>
To   "" <>
Subject   st: RE: Re: Marginal effects after ivreg2
Date   Thu, 26 Dec 2013 13:02:16 +0000


-ivreg2- doesn't (yet - we really need to add this in!) support -margins-.  But an easy workaround is to use -nlcom- with -ivreg2-.

Below is an example of how to use -nlcom- to mimic -margins- to calculate marginal effects and CIs when you have an interaction.


sysuse auto, clear
gen mpgturn=mpg*turn
regress price mpg turn mpgturn
qui sum turn, meanonly
nlcom _b[mpg] + _b[mpgturn]*(`r(mean)')
qui sum mpg, meanonly
nlcom _b[turn] + _b[mpgturn]*(`r(mean)')
regress price mpg turn c.mpg#c.turn
margins, atmeans dydx(*)

> -----Original Message-----
> From: [mailto:owner-
>] On Behalf Of Jana von Stein
> Sent: 26 December 2013 01:59
> To: <>
> Subject: st: Re: Marginal effects after ivreg2
> Hello,
> I need to run margins (or calculate marginal effects with ci's) after ivreg2. I
> have an endogenous interaction and want to calculate the marginal effect (w/
> ci's) after ivreg2. Does anyone know how to do this? Margins did not seem to
> work after ivreg2.
> Thanks, and happy holidays.
> Jana
> *
> *   For searches and help try:
> *
> *
> *

Sunday Times Scottish University of the Year 2011-2013
Top in the UK for student experience
Fourth university in the UK and top in Scotland (National Student Survey 2012)

We invite research leaders and ambitious early career researchers to 
join us in leading and driving research in key inter-disciplinary themes. 
Please see for further information and how
to apply.

Heriot-Watt University is a Scottish charity
registered under charity number SC000278.

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index