Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: AW: Plotting marginal effects
From
"Martin Weiss" <[email protected]>
To
<[email protected]>
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: [email protected]
[mailto:[email protected]] Im Auftrag von Lorenzo Ciari
Gesendet: Donnerstag, 3. Juni 2010 16:49
An: [email protected]
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/