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: AW: Plotting marginal effects

From   "Martin Weiss" <>
To   <>
Subject   st: AW: Plotting marginal effects
Date   Thu, 3 Jun 2010 17:09:27 +0200


This draws a graph of the marginal effect of "length" on the probability of
"foreign", for different "rep78" values.

 -postfile- example 

sysuse auto, clear
probit foreign length weight rep78

tempname hdle

capt erase info.dta

postfile `hdle' repvalue dydx /* 
*/ using info

qui forv i=1/5{
		mfx compute, varlist(length) /* 
		*/ dydx at(mean rep78=`i')
		mat A=e(Xmfx_dydx)
		post `hdle' (`i') (A[1,1])

postclose `hdle'

u info, clear
l, noo

tw (connect dydx repvalue)


-----Ursprüngliche Nachricht-----
[] Im Auftrag von Lorenzo Ciari
Gesendet: Donnerstag, 3. Juni 2010 16:49
Betreff: st: Plotting marginal effects

I have a question. I have estimated a probit model and I would like to 
plot the marginal effect condititional on all the different values of an 
independent variable in my model.

Suppose my model is    Y=a+ b1X1+b2X2+ e

I can get a marginal effect of X1 for different values of X2 (by running 
mfx, at(X2=...). What I would like to do is to plot the marginal effect 
of X1 for all the values taken by X2. Is that possible?


*   For searches and help try:

*   For searches and help try:

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