Diff in difference in predicted prob in binary regressions
grdidip [if exp] [in range] [, x1(variables_and_values) x2(variables_and_values) x3(variables_and_values) x4(variables_and_values) rest(stat) level(#) nobase all]
where variables_and_values is an alternating list of variables and either numeric values or mean, median, min, max, upper, lower, previous.
stat is either mean, median, min, max, upper, lower, previous, grmean(group mean), mrmedian, grmin, grmax.
Description
After estimating a binary regression model, grdidip computes the difference in difference in predicted probabilities: {P(x*b|x4)-P(x*b|x3)}-{P(x*b|x2)-P(x*b|x1)}. grdidip uses 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 their mean (default), minimum, maximum, median when calculating predicted values. grmean sets these independent variables to the mean conditional on the variables and values specified in x(); grmedian,grmax, and grmin can also be used.
nobase suppresses inclusion of the base values of x in the output.
all specifies that any calculations of means, medians, etc., should use the entire sample instead of the sample used to estimate the model.
Returned Matrices
r(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.
Examples
To 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