------------------------------------------------------------------------------- help forgrdidip- v001 25dec2009 jx -------------------------------------------------------------------------------

Diff in difference in predicted prob in binary regressions

grdidip[ifexp] [inrange] [,x1(variables_and_values)x2(variables_and_values)x3(variables_and_values)x4(variables_and_values)rest(stat)level(#)nobaseall]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,

grdidipcomputes the difference in difference in predicted probabilities: {P(x*b|x4)-P(x*b|x3)}-{P(x*b|x2)-P(x*b|x1)}.grdidipuses a closed form solution with the delta method. It is especially useful for comparing the effects of nomial level independent variables. With this program, we make comparisons between two groups, and vary the values of a specific continuous variable while holding everything else to be the same.

Options

level()sets the level of the confidence interval for differences in difference in predicted probabilities. The default confidence level is 95.

x1()sets the values of independent variables for x1 vector used in {P(x*b|x4)-P(x*b|x3)}-{P(x*b|x2)-P(x*b|x1)}. The list must alternate variable names and values. The values may be either numeric values or they 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).

x2()sets the values of independent variables for x2 vector.

x3()sets the values of independent variables for x3 vector.

x4()sets the values of independent variables for x4 vector.

rest()sets the independent variables not specified in x1() to x4() 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.

Returned Matricesr(didipmat): saves differences in difference in predicted probabilities and their confidence intervals

r(didipp1s): saves predicted probabilities (P(y=1|x)) for x1, x2, x3, and x4 vectors.

ExamplesTo compute the difference in difference in predicted probabilities and confidence intervals using delta method for a logit model with all other variables set at their means except for black and education.

.logit vote black educ income

.grdidip, x1(black=1 educ=12) x2(black=1 educ=20) x3(black=0 educ=12)x4(black=0 educ=20):::

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

Authors: Jun Xu