------------------------------------------------------------------------------- help for_grmargd28Feb2011 -------------------------------------------------------------------------------

Marginal effects and their differences in binary regressions using the delta me> thod for inference

_grmargd[ifexp] [inrange] [,x(variables_and_values)rest(stat)nobasealllevel(#)savediffdydxmat(matrix_kxk)]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,

_grmargdcomputes the predicted marginal effects at specific values of the independent variables, or differences in marginal effects at two different x vectors. confidence intervals are available using the delta method with closed form analytic solutions. This low utility program also provides retued matrices (see below).

Options

savesaves current values of independent variables and predictions (marginal effects) for computing changes using the diff option.

diffcomputes difference between current predictions (marginal effects) and those that were saved.

level()sets the level of the confidence interval for predicted values or marginal effects for the commands for which these are provided. 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.

nobasesuppresses inclusion of the base values of x in the output.

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

dydxmat(matrix_kxk)supplies a matrix by users of dy/dx or dxb/dx, where there is polynomial or interaction terms.

Returned Matricesr(marg): saves marginal effects.

r(margci): saves confidence intervals for marginal effects

r(margvar): saves variance-covariance matrix for marginal effects

r(margse): saves standard errors for marginal effects

r(dmarg): saves differences in marginal effects when

diffoption is usedr(dmargci): saves confidence intervals for differences in marginal effects when

diffoption is used.

ExamplesTo compute the predicted marginal effects and confidence intervals using delta method for a logit in which all independent variables are held at the mean.

.logit vote black educ income

._grmargd, x(black=1 educ=16) save

._grmargd, x(black=0 educ=16) diffWhat if there is interaction terms or polynomial terms? Here is an example.

.gen age2=age*age

.logit lfp age age2 k5 inc

._grmargd, x(age=20 age2=400) dydxmat(1, 20, 0, 0, 0 \ 0, 1, 0, 0, 0 \ 0,0, 1, 0, 0 \ 0, 0, 0, 1, 0 \ 0, 0, 0, 0, 1):::

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

Authors: Jun Xu