Professional Documents
Culture Documents
MFX
MFX
clear
use http://www.stata-press.com/data/imeus/womenwk, clear
log using mfx.log, replace
/* As we will see later, the marginal effect of a change in age does not
change the predicted probability by 4%. Rather, it changes it by 1.5% */
*************************************************
/* Predicted Probabilities- Probit */
********************************************
predict y_xb, xb
summ y_xb
/* Above we can see that y_xb is not bounded between zero and one and there are
also negative projections. Both of these facts illustrate that just
multiplying each regression parameter estimate by the values of the independent
variables is not how the probit model calculates predicted probabilities.
This piece is just one part of the equation. The other part is inputting XB into
the CDF of the relevant distribution which is the standard normal for porbit
and the logistic for logit. */
/* Our manual calculation agrees to Stata's prediction using xb, but we know
the predicted probability is not a actually negative number */
/* Next, calculate the actual predicted probabilities using CDF(XB). Note here
we are actually using the CDF and *not* the PDF because the CDF is used for
the overall actual predicted probability whereas the PDF is used for the
marginal effect. */
predict y_pr, p
summ y_pr
/* Above, can see that the actual predicted probabilities are bounded between
zero and one. Next, we manually calculate this probability for the first
observation by feeding in the value of XB into the cumulative standard
normal distribution */
**************************************************
/* Marginal Effects- Probit */
******************************************
probit work age
mfx compute
summ age
summ marginal_at_mean
margeff
summ marginal
****************************************
/* Predicted Probabilities- Logit */
**************************************
/* Can see above that the marginal effect is approximately 1.5%, similar to
the probit model. And again, the marginal effect is different from the
coefficient estimate of .0726359. */
predict y_xb, xb
summ y_xb
/* Again, there are negative projections and projections greater than one if we
simply multiply each Beta_hat times the independent variable values. */
predict y_pr, p
summ y_pr
/* When putting XB into the logistic CDF, probabilities are now bounded
between zero and 1 and there are no negative probabilities. */
summ marginal
log close