Marginal effects of a logistic model, and their standard errors I am using SAS to estimate some logistic models. Usually, I work with either MDs or social scientists, and odds ratios are the preferred metric. But I am now working with a client in economics/law and she wants the marginal effects and their standard errors, and she wants them at the means of the other variables.
This isn't easy in SAS, but, with help from tech support, I found that you can do this with PROC NLMIXED, I believe you then need the out = der option. Something like this
proc nlmixed data=olivia.small;
  p=1/(1+exp(-(Intercept+ba*log_fund_age + bb*log_fund_size + bc*yield + bd*loaded + be*log_assets)));
  model vote_code_num ~ binomial(1,p);
  parms intercept 36.43 ba -14.55 bb -0.98 bc -0.37 bd 2.2 be -0.07;
  predict p*(1-p)*ba out=a der;
  predict p*(1-p)*bb out=b der;
  predict p*(1-p)*bc out=c der;
  predict p*(1-p)*bd out=d der;
  predict p*(1-p)*be out=e der;
  where year = 2003;
  run;

but then the output data sets a, b, c, d and e have the derivatives and their standard deviations for each observation in the data set, not for the mean of the other variables. It's easy to find the mean of all those derivatives, but 1) Is that the same as the marginal at the mean of the other variables? and 2) How then to get the standard errors?
Peter
 A: Some people would find such 'marginal effects' difficult to interpret and non-unique.  There are other ways to get 'marginal effects' in binary logistic regression.  Because of non-collapsibility of the odds ratio, marginal estimates are not well defined in general, and they can represent quantities that are not weighted averages over the factors you are unconditioning on.  Mitch Gail has an example where the partial odds ratio for an exposure x2 is 9 for both x1=0 and x1=1 but is 5.44 when not holding x1 constant.
@ARTICLE{gai84bia,
  author = {Gail, M.H. and Wieand, S. and Piantadosi, S.},
  year = 1984,
  title = {Biased estimates of treatment effect in randomized experiments with
          nonlinear regressions and omitted covariates},
  journal = Biometrika,
  volume = 71,
  pages = {431-444},
  annote = {covariable adjustment;bias if omitted covariables and model is
           nonlinear}
}

I wonder also whether you meant 'marginal effect' or 'effect on the original scale'.  That would involve two different considerations.  Effects on the log odds scale are easier to deal with, and you can relate odds ratios to absolute risk changes (as a function of starting risk) using a simple chart.
A: SAS Tech support solved this with the (now obvious) idea of adding a variable to the data set that has the average of all the variables.
Peter
