help for gradip                                            - v001 08dec2009 jx 

Compute averaged differences in predicted probabilities in binary regressions

gradip varname [if] [in] , [from(#) to(#)] [x(variables_and_values) rest(stat) all reps(#) size(#) group(varname) dots}]

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), grmedian, grmin, grmax.


gradip computes average differences in predicted probabilities over a range of a continuous variable c from v1 to v2 between Group 1 and 0 using the bootstrap method. The formula in logit model is: {b_c*(v2-v1)}^(-1){[ln(exp(xb|g=1,c=v2)+1)-ln(exp(xb|g=0,c=v2)+1] - [ln(exp(xb|g=1,c=v1)+1)-ln(exp(xb|g=0,c=v1)+1]}.


from() and to() specify the values over which varname should vary when calculating differences in predicted probabilities.

x() sets the values of independent variables for calculating predicted probabilities. 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 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.

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.

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

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.

dots requests 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.

group identifies a group indicator variable. This variable needs to be in the estimation. One group is coded as 1 and the other group is coded as 0 (G1-G0). To compare two groups when we have multiple groups, we need to be also specify 0's for other group indicator variables. For example, we have three groups, Asians, Blacks, and Whites. If we want to compare Asians with Whites, and Asian is the omitted category. Then in the rest option, we need to set Blacks to be zero, and in this group option, we just need to specify Whites.

Returned Matrices

r(adipmat): saves summed differences in predicted probabilities between two groups. Note that to get average differences in predicted probabilities, users need to divide the matrix by taking the differences between from() and to().


To compute the average difference in predicted probabilities and confidence intervals using bootstrap method for a logit model with all other variables set at their means except for black (between black=1 and black=1) and education (from 12 to 20).

.logit vote black educ income

gradip educ, group(black) from(12) to(20) reps(1000) dots



Authors: Jun Xu