# calculating a marginal effect for logit model

For the logit estimate of the slope parameter,I would like to obtain the marginal effect of the regressor ndisease evaluated at $$\Lambda (x'\beta)=\bar{y}$$, where $$\bar{y}$$ is mean of $$y$$.

I obtain the logic estimation as follows:

How can I calculate this marginal effect by using Stata?

For marginal effects you can use margins. This is postestimation command so it should be run after you estimate your regression.

You seem to be running:

logit DMED NDISEASE

afterwards you can run:

margins, predict(p outcome(1)) varlist(NDISEASE)

I am sure margins will give you the marginal effects, the other commands after comma might need adjusting depending on your specific problem, since you dont provide minimal working example thats the most I can do. You can have look at manual for margins.

• Thank you. I know the command "marigins" gives the marginal effect. But, the question asks for a specific type of marginal effect. I guess, the question asks the marginal effect at the $x_i$ that coincides with the average observation value of $y$. I would like to learn how can I do this specific one. Commented Apr 5, 2022 at 18:55
• @1190 that’s what the commands after margins should do
– 1muflon1
Commented Apr 5, 2022 at 19:06