------------------------------------------------------------------------------- help forgrmarg- v001 28feb2011 jx -------------------------------------------------------------------------------

Marginal effects and their differences from binary regressions

grmarg[if] [in] [,x(variables_and_values)rest(stat)level(#)deltabootstrapreps(#)size(#)savediffnobaseall match dotsdydxmat(matrix_kxk)]where

variables_and_valuesis an alternating list of variables and either numeric values or mean, median, min, max, upper, lower, previous andstatis either mean, median, min, max, upper, lower, previous, grmean(group mean), mrmedian, grmin, grmax.

Description

grmargis a command that returns marginal effects, differences in marginal effects and their confidence intervals using both bootstrap and delta methods

Options

x(variables_and_values)sets the values of independent variables for calculating predicted values (marginal effects). The list must alternate variable names and either numeric values or types ofstat.

rest(stat)sets the independent variables not specified inx(variables_and_values)to one of the types ofstat.

level()sets the level of the confidence interval for predicted values or probabilities for the commands for which these are provided. The default is 95.

deltacalculates confidence intervals by the delta method using analytical derivatives. This method works with cloglog, logistic, logit and probit.

bootstrapcomputes confidence intervals using the bootstrap method. This method takes roughly 1,000 times longer to compute than other methods. This method works with cloglog, logistic, logit, and probit.

reps(#)specifies the number of bootstrap replications to be performed. The default is 1000.

size(#)specifies the size of the samples to be drawn. The default is e(N), the same size as the estimation sample.

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

diffcomputes difference between current predictions and those that were saved.

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

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

matchrequestsgrmargto resample from each category group of the dependent variable in proportion of the resample size to the original sample size.

dotsrequests a dot be placed on the screen at the beginning of each replication, thus providing entertainment when a large number of reps() are requested. It also prints out the percent replications finished.

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

ExamplesTo compute the predicted marginal effects, differences in marginal effects, and their confidence intervals using the delta method for a logit model. All independent variables are held at their means except for black and education specifed in x().

.logit vote black educ income

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

.grmarg, x(black=0 educ=16) diff:::

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

Authors: Jun Xu