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, statalist.org 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" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
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)
*************



HTH
Martin

-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Lorenzo Ciari
Gesendet: Donnerstag, 3. Juni 2010 16:49
An: statalist@hsphsun2.harvard.edu
Betreff: st: Plotting marginal effects

Hallo,
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?

Thanks,
lorenzo

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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