------------------------------------------------------------------------------- help formargeff8(This version: 10 February 2006) -------------------------------------------------------------------------------

Marginal effects for categorical dependent variable models

margeff8[compute] [ifexp] [inrange] [,at(atlist)countnodiscretedummies(varlist_1[\varlist_2..])eformmodel(stata_cmd)nooffsetoutcome(numlist)percentreplace]

margeff8replaywhere

stata_cmdis one of[group 1:] probit logit logistic cloglog heckprob xtprobit > [group 2:] oprobit ologit gologit mlogit biprobit [group 3:] poisson nbreg zip zinb

and

atlistis {mean|median|zero[varname=#[,varname=#] [...]] } { [mean] |[median] | [zero]varname=#[,varname=#] [...] }and

varlist_1[\varlist_2... ] are lists of dummy variables, where all dummies of a list indicate different categories of the same underlying categorical variable.

Description

margeff8 computeanalytically estimates marginal effects, and standard errors for marginal effects using the delta method. The default behavior ofmargeff8is the following:

1.margeff8calculates average marginal effects, that is, changes in the quantities of interest evaluated for each observations, and the reported marginal effects are sample averages of these changes. Note thatmargeff8can also compute marginal effects evaluated at sample means or at other values if the user specifies theat(atlist)option. Calculations are restricted to the estimation sample.

2.For continuous variables, marginal effects are partial changes in the quantities of interest. For dummy variables, marginal effects are discrete changes in the quantities of interest as the dummy variable changes from 0 to 1. Dummies are automatically detected. Before usingmargeff8, please make sure that you coded your dummy variables as 0/1 variables. Otherwise your dummies will be considered as being continuous variables, and you run the risk of obtaining misleading results. Users can change this behavior by specifying thecountornodiscreteoptions.

3.Quantities of interest are defined as follows:[group 1:] the probability of positive outcome [group 2:] the probabilities of all possible outcomes defined by the dependent variable(s) [group 3:] the expected number of counts or the incidence rate

4.margeff8supports only the above listed models. Themodel(stata_cmd)option, however, adds some flexibility. This is useful if users wish to obtain marginal effects after the survey version ofstata_cmd, or after their own program.

5.margeff8behaves as a post-estimation command (see help postest). However, optionreplaceforcesmargeff8to behave as an estimation command (see help est). This enables the use of post-estimation commands likelincomortestaftermargeff8.Typed without arguments,

margeff8replays the results of the previousmargeff8computations, provided the last use ofmargeff8was combined with thereplaceoption.

margeff8 replayreplays the results of the previousmargeff8computation.

Options

at(atlist)forcesmargeff8to estimate marginal effects at points specified inatlist, instead of estimating average marginal effects.

at(mean|median|zero[varname=#[,varname=#[...]])specifies that the marginal effects be evaluated at means, at medians of the independent variables, or at zeros. It also allows users to specify particular values for one or more independent variables, assuming that the rest are means, medians, or zeros.

at([mean] |[median] | [zero]varname=#[,varname=#] [...])specifies that the marginal effects be evaluated at particular values for one or more independent variables, assuming that the rest are means.

countmodifies the calculation of marginal effects for count variables, i.e. variables that take more than two values and all of the values are integers. By default,margeff8treates count variables as continuous variables, thus marginal effects correspont to small changes in the independent variables. If the count option is specified, the marginal effects are changes in probabilities when the count variables increase by unity.

nodiscreteforcesmargeff8to treat dummy variables as if they were continuous. Recall that ifnodiscreteis not specified, the marginal effect of a dummy variable is calculated as the discrete change in the expected value of the dependent variable as the dummy variable changes from 0 to 1.

dummies(varlist_1[\varlist_2... ])modifies the calculation of marginal effects for dummy variables. Letxvarbe a categorical variables withK+1 (K>1) categories. In this case, not xvar, butKdummies - say, D1, ..., DK - are included in the regression model. The estimated marginal effects for theseKdummies may be misleading (see the example below). The correct result is obtained if one specifies thedummies(D*)option.

eformforcesmargeff8to define the quantity of interest asexp(xb), wherexbis the linear prediction.

model(stata_cmd)forcesmargeff8to estimate marginal effects as if the preceeding estimation command werestata_cmd.stata_cmdmust be one of the supported commands that are listed above. Themodel(stata_cmd)is likely to be helpful if you wish to obtain marginal effects after the survey version of a supported estimation command, or you wish to estimate a supported model using glm. The estimates, however, will be meaningful only if the estimation command issued by the user andstata_cmdhave the same link functions. It is the user's responsibility to ensure that this condition holds.

nooffsetcausesmargeff8to ignore the offset variable during the calculations.

outcome(numlist)causesmargeff8to display only the probability outcomes corresponding to the numbers specifiednumlist(see numlist for syntax guide). This option is useful after estimation commands listed as [group 2] models. The correspondence rule is the following:1.Afterbiprobit, numbers 1 2 3 and 4 refer to outcomes p00 p01 p10 p11.2.Afterologit,oprobit,gologitandmlogit, number # refers to the #th category of the dependent variable. Thus, number 1 always indicates the lowest category. And if the dependent variable has, say, 5 categories, then number 5 indicates the highest category.

percentcausesmargeff8to display the results in a percentage form.

replacecausesmargeff8to overwrite the estimation results left behind. This option is useful if1.you wish to include marginal effects in publication-quality tables using either the official estimates table command or the user-written commands outreg or estout; or2.your model contains a variable (such as age-squared) which is a mathematical transformation of another independent variable, and you wish to obtain the total effect of that variable (age) using the lincom or the nlcom command.

Remarks

margeff8is a work-in-progress; comments, suggestions, bug reports are welcome! Please direct correspondence to the adress described at the end of the help file. To keepmargeff8up-to-date, visit the website http://www.uni-corvinus.hu/bartus or typenet from http://www.uni-corvinus.hu/bartus/statanet install margeff8

Examples

Illustrating the importance of the dummies( varlist_1 \ ... ) optionType the following commands:

. [save mydata, replace]. tabi 60 30 10 \ 20 60 20 \ 10 10 80 , replace. xi: mlogit col i.row [fw=pop]. margeff8You will see that the marginal effects do not correspond to changes in probabilities in the 3X3 table. Only the changes in the probabilities of the third outcome approximate the true changes, namely 0.1 and 0.7. The correct results are obtained after specifying the dummies(..) option:

. margeff8, dummies(_I*)

Easy calculation of the total effect of ageSuppose you wish to model employment status as a function of the usual human capital variables: gender, years of education, experience, and the square of experience. Assume further that the sample average of experience is 20. The total effect of experience on employment probabilities can be estimated as follows:

. logit employed gender edu exp exp2. margeff8, at(mean) replace. lincom exp+40*exp2

AcknowledgementsSome parts of the code relies on margfx (version 30 Jul 1999 for Stata 5) written by Jonah B. Gelbach, Dept of Economics, Univ of MD at College Park.

Also seeOnline: help for est, postest; mfx

AuthorTamas Bartus Department of Sociology and Social Policy, Corvinus University Budapest, Budapest, Hungary URL: http://www.uni-corvinus.hu/bartus Email: tamas.bartus@uni-corvinus.hu