------------------------------------------------------------------------------- help forgrdiame- v001 25dec2009 jx -------------------------------------------------------------------------------

Differences in Averaged Marginal effects in binary regressions

grdiame[ifexp] [inrange] [,x(variables_and_values)rest(stat)level(#)allgroup(grpvar_g0value_g1value)]where

variables_and_valuesis an alternating list of variables and either numeric values or mean, median, min, max, upper, lower, previous.

statis either mean, median, min, max, upper, lower, previous, grmean(group mean), mrmedian, grmin, grmax.

DescriptionAfter estimating a binary regression model,

grdiamecomputes the differences in average marginal effects between the 1 and 0 groups coded by thegroupvariable.grdiameuses a closed form solution with the delta method.

Options

level()sets the level of the confidence interval for differences in group average marginal effects. The default is 95.

x()sets the values of independent variables for calculating predicted values. The list must alternate variable names and values. The values may be either numeric values or can be mean, median, min, max, previous, upper, or lower. The latter cannot be used if rest() specifies a group summary statistic (e.g., grmean).

rest()sets the independent variables not specified in x() to theirmean(default),minimum,maximum,medianwhen calculating predicted values.grmeansets these independent variables to the mean conditional on the variables and values specified in x();grmedian,grmax, andgrmincan also be used.

allspecifies that any calculations of means, medians, etc., should use the entire sample instead of the sample used to estimate the model.

groupidentifies a group indictor variable. After the group variable, specify the value for the group 0, then the value for group 1 of the group variable. This program takes a difference of AMEg1-AMEg0.

Returned Matricesr(avgmarg): saves group average marginal effects.

r(avgmargdif): saves differences in and confidence intervals for group average marginal effects

ExamplesTo compute the differences in group average marginal effects and confidence intervals using delta method for a logit in which all independent variables are held at the mean, and we compare black with whites.

.logit vote black asian hispn educ income

.grdiame, group(race 1 4)In this case, the grdiame compares group averaged marginal effects between whites (race=1) and asians (race=4).

:::

-------------------------------------------------------------------------------

Authors: Jun Xu