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]

Re: st: predicted marginal effects for sample

From   Richard Williams <>
Subject   Re: st: predicted marginal effects for sample
Date   Sun, 04 Dec 2011 20:53:01 -0500

At 06:31 PM 12/4/2011, john sanders wrote:
I am running a simple linear regression model with some interaction
terms of the following nature:

reg demand c.distance##c.price##c.price

I want to use the model parameters to predict the marginal effect of a
price change for every observation in the data (i.e. instead of the
linear prediction, I want the marginal effect for each observation).

Is this possible using the margins command? I could certainly code
this up, but I was wondering if there was a "predict" analogue to the
margins command.

In Microeconomics Using Stata, Revised Edition, Cameron and Trivedi show (in Section 10.6) how to manually compute AMEs. See

The code they use can be found at

Look specifically at the file . The sections you may be interested in start with the line "* AME computed manually for a single regressor" .

Their examples are for continuous variables. For an example using discrete variables, see slides 27-30 of

Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  Richard.A.Williams.5@ND.Edu

*   For searches and help try:

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