I have a logistic regression model with a large number of binary RHS variables (some entered as class variables). I want to calculate average marginal effects of each predictor. If these were continuous variables, I would calculate this as p(1-p)B[i] where p is the predicted probability for each case, and B[i] is the i'th parameter. Following http://support.sas.com/kb/22/604.html I could use proc qlim to do this for me. I would then calculate the average of these estimates across cases to get an average marginal effect for each parameter. My understanding, however, is that for binary variables a different approach is conventionally used. For each case, two predicted values are calculated. First, the value when X[i] is set = 0 and other X values at their original value, and second, when X[i] = 1 and other X values are set equal to their predicted values. The difference between these is the marginal effect for parameter i for each case - this can then be averaged across cases. This binary case seems very messy to calculate, particularly with class variables. Does anyone have any example calculations? Indeed, is this really necessary? I would presume that the marginal effect should be very close to the binary comparison particularly when the B[i] are small.
... View more