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?