# Re: st: margeff and svy: probit

 From Richard Williams To statalist@hsphsun2.harvard.edu Subject Re: st: margeff and svy: probit Date Wed, 26 Jul 2006 17:18:58 -0500

At 03:58 PM 7/26/2006, smerryman@kc.rr.com wrote:
At first glance, it looks like line 54 should be changed from

SetSMacros `model' `eform'
to
SetSMacros "`model'" "`eform'"

This will result in:

. margeff, at(mean) model(garbage garbage)
-margeff- does not work with garbage garbage; use -mfx- instead
Good catch! It is hard for programmers to anticipate every error a user might make.

As a sidelight, it looks to me like margeff gives the wrong standard errors and Z values when using ologit and oprobit, although probit and logit appear fine. As the following indicates, margeff and mfx give very different results after oprobit; but give identical results when the equivalent problem is run in probit.

. use "http://www.stata-press.com/data/r9/nhanes2f.dta";

. version 8.2: oprobit heartatk height weight female black

Iteration 0: log likelihood = -1920.8319
Iteration 1: log likelihood = -1856.5932
Iteration 2: log likelihood = -1855.4195
Iteration 3: log likelihood = -1855.4187

Ordered probit estimates Number of obs = 10335
LR chi2(4) = 130.83
Prob > chi2 = 0.0000
Log likelihood = -1855.4187 Pseudo R2 = 0.0341

------------------------------------------------------------------------------
heartatk | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
height | -.0251294 .0033885 -7.42 0.000 -.0317707 -.0184882
weight | .0060811 .0015925 3.82 0.000 .0029598 .0092025
female | -.6483638 .0622329 -10.42 0.000 -.770338 -.5263896
black | -.0274113 .07229 -0.38 0.705 -.1690971 .1142745
-------------+----------------------------------------------------------------
_cut1 | -2.378549 .55614 (Ancillary parameter)
------------------------------------------------------------------------------

. margeff, at(mean)
-2.3785485

Marginal effects at means on Prob(heartatk) after oprobit

------------------------------------------------------------------------------
heartatk | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
0 |
height | .0022043 .0039447 0.56 0.576 -.0055271 .0099357
weight | -.0005334 .0010152 -0.53 0.599 -.0025232 .0014563
female | .060484 .1080804 0.56 0.576 -.1513497 .2723177
black | .0023596 .0076294 0.31 0.757 -.0125936 .0173129
-------------+----------------------------------------------------------------
1 |
height | -.0022043 .0039447 -0.56 0.576 -.0099357 .0055271
weight | .0005334 .0010152 0.53 0.599 -.0014563 .0025232
female | -.060484 .1080804 -0.56 0.576 -.2723177 .1513497
black | -.0023596 .0076294 -0.31 0.757 -.0173129 .0125936
------------------------------------------------------------------------------

. mfx, predict(o(1))

Marginal effects after oprobit
y = Pr(heartatk==1) (predict, o(1))
= .04088538
------------------------------------------------------------------------------
variable | dy/dx Std. Err. z P>|z| [ 95% C.I. ] X
---------+--------------------------------------------------------------------
height | -.0022043 .00029 -7.58 0.000 -.002774 -.001634 167.653
weight | .0005334 .00014 3.85 0.000 .000262 .000805 71.9031
female*| -.060484 .00603 -10.02 0.000 -.072312 -.048656 .525012
black*| -.0023596 .00611 -0.39 0.699 -.014327 .009607 .10508
------------------------------------------------------------------------------
(*) dy/dx is for discrete change of dummy variable from 0 to 1

. probit heartatk height weight female black

Iteration 0: log likelihood = -1920.8319
Iteration 1: log likelihood = -1856.5932
Iteration 2: log likelihood = -1855.4195
Iteration 3: log likelihood = -1855.4187

Probit regression Number of obs = 10335
LR chi2(4) = 130.83
Prob > chi2 = 0.0000
Log likelihood = -1855.4187 Pseudo R2 = 0.0341

------------------------------------------------------------------------------
heartatk | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
height | -.0251294 .0033885 -7.42 0.000 -.0317707 -.0184882
weight | .0060811 .0015925 3.82 0.000 .0029598 .0092025
female | -.6483638 .0622329 -10.42 0.000 -.770338 -.5263896
black | -.0274113 .07229 -0.38 0.705 -.1690971 .1142745
_cons | 2.378549 .55614 4.28 0.000 1.288534 3.468563
------------------------------------------------------------------------------

. margeff, at(mean)

Marginal effects at means on Prob(heartatk==1) after probit

------------------------------------------------------------------------------
heartatk | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
height | -.0022043 .0002908 -7.58 0.000 -.0027743 -.0016343
weight | .0005334 .0001387 3.85 0.000 .0002616 .0008053
female | -.060484 .0060349 -10.02 0.000 -.0723122 -.0486558
black | -.0023596 .0061058 -0.39 0.699 -.0143267 .0096075
------------------------------------------------------------------------------

. mfx

Marginal effects after probit
y = Pr(heartatk) (predict)
= .04088538
------------------------------------------------------------------------------
variable | dy/dx Std. Err. z P>|z| [ 95% C.I. ] X
---------+--------------------------------------------------------------------
height | -.0022043 .00029 -7.58 0.000 -.002774 -.001634 167.653
weight | .0005334 .00014 3.85 0.000 .000262 .000805 71.9031
female*| -.060484 .00603 -10.02 0.000 -.072312 -.048656 .525012
black*| -.0023596 .00611 -0.39 0.699 -.014327 .009607 .10508
------------------------------------------------------------------------------
(*) dy/dx is for discrete change of dummy variable from 0 to 1

-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: Richard.A.Williams.5@ND.Edu
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/