statsmodels/statsmodels — pull request #410 by jseabold (2012-07-25 23:05:00+00:00)
Title: Discrete model marginal effects

Cleans up the marginal effects for discrete models. Now computes standard errors, which should close #393. Also handles counts and discrete variables correctly. All dummy variables will be compared against the base case. This closes #377.

Everything is tested versus Stata except 'eydx' for count=True. I don't see this available anywhere. The built-in margins handles counts as if continuous.

I pulled out the marginal effects computations from DiscreteResults.margeff and deprecated this method. Slowly working towards making this general for other models. Still not sure what else we'll need yet until I look at Tobit and non-linear models again.

I've started to like this pattern of get_something which returns some object. So the way it is now, you would do.

```python
data = sm.datasets.spector.load()
data.exog = sm.add_constant(data.exog)
res = sm.Logit(data.endog, data.exog).fit(method="newton", disp=0)
me = res.get_margeff(dummy=True, count=True)
print me.margeff
print me.margeff_se
print me.margeff_cov
```

I may need to do one more pass over the docs while it's fresh on my mind, but I don't have time now.