Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: margins, dydx for systems

From   Christopher Baum <>
To   "" <>
Subject   st: margins, dydx for systems
Date   Mon, 12 Nov 2012 12:29:21 +0000

Dear tech support,

I am using Stata 12.1, fully updated, s/n  5012041613. Please see the code fragment below. I would like to test that the effect of mvalue1 in the first equation is equal to the effect of mvalue2 in the second equation, given the interaction term involving the latter. In example 14 of [R] margins, it illustrates how one can test that the predictive mean is equal across equations, but I want to test an expression involving the derivative, which in turn involves an interaction term. The below code does not work because expression is not a repeatable option. I know how to compute the average marginal effect 'by hand' from the second equation, but wondered whether the margins apparatus was capable of doing so itself, as it is in many other circumstances. 

webuse grunfeld,clear
keep if company<3
reshape wide invest mvalue kstock, i(year) j(company)
sureg (invest1 kstock1 mvalue1) (invest2 c.kstock2##c.mvalue2)
margins, dydx(_all) expression(predict(equation(invest1))) expression(predict(equation(invest2))) post

Thanks, and happy Veterans' Day! It is not a holiday where I work, but there were ceremonies over the weekend on campus.

Best wishes

Kit Baum   |   Boston College Economics & DIW Berlin   |
                             An Introduction to Stata Programming  |
  An Introduction to Modern Econometrics Using Stata  |

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index