Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: mfx2 1.1.0 now available


From   Richard Williams <[email protected]>
To   [email protected]
Subject   Re: st: mfx2 1.1.0 now available
Date   Tue, 19 Jun 2007 22:21:32 -0500

Kit Baum suggested a couple of clarifications and corrections to my announcement about mfx2, so here is the revised version:

Thanks to Kit Baum, a new version of mfx2 is now available from SSC. Type -ssc install mfx2, replace-. It requires Stata 8.2 or higher. The new version now supports the -varlist- option of -mfx-. This can greatly speed up execution time when marginal effects are only needed for a few variables.

Here is a more complete description of the program:

mfx2 obtains marginal effects or elasticities after estimation. It is probably most useful after multiple-outcome commands like ologit, oprobit, gologit2, slogit, mlogit, oglm, and mprobit but it works with other commands as well.

mfx2 offers two key enhancements to Stata's mfx compute command: (a) after multiple-outcome estimation commands mfx2 automates the calling of mfx and saves the marginal effects for all outcomes in a single matrix; and (b) both the model estimates and the marginal effects are stored in a way that makes them easy to use with post-estimation table formatting commands like Roy Wada's outreg2 and Ben Jann's estout/esttab.

It is important to realize that, if mfx does not work for your problem, then mfx2 isn't going to work either. mfx2 simplifies the use of mfx and restructures mfx's output for easier use with table formatting programs. But, when it comes to actually estimating the marginal effects mfx2 has the same limitations that mfx does. Other marginal effects commands (e.g. margeff, inteff) may be more appropriate for your specific purpose.

The following example illustrates mfx2's utility. The same data and variables are analyzed using 4 different categorical data analysis models/commands. By comparing the marginal effects side by side in a table created by esttab, you can get a feel for the practical differences between the models. If you tried the same thing using mfx, you would have to give 4 times as many mfx commands (one for each category of the outcome variable) and it would also be much more tedious to get the results into a table. The -nose- (no standard error) and -nolog- options can be used to greatly speed up the calculations and unclutter the display (mfx is no speed demon, and neither is mfx2). The most current versions of mfx2, oglm, gologit2, and estout (all available from SSC) should be installed for this example.

use "http://www.indiana.edu/~jslsoc/stata/spex_data/ordwarm2.dta";, clear
ologit warm yr89 male white age ed prst
mfx2, nolog varlist(yr89 male)
oglm warm yr89 male white age ed prst, het( yr89 male)
mfx2, nolog varlist(yr89 male)
gologit2 warm yr89 male white age ed prst, npl( yr89 male)
mfx2, nolog varlist(yr89 male)
mlogit warm yr89 male white age ed prst
mfx2, nolog varlist(yr89 male)
esttab ologit_mfx oglm_mfx gologit2_mfx mlogit_mfx, mtitles se nonumbers


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME: (574)289-5227
EMAIL: [email protected]
WWW: http://www.nd.edu/~rwilliam

*
* 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/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index