<p>For marginal effects you can use <code>margins</code>. This is postestimation command so it should be run after you estimate your regression.</p>
<p>You seem to be running:</p>
<p><code>logit DMED NDISEASE</code></p>
<p>afterwards you can run:</p>
<p><code>margins, predict(p outcome(1)) varlist(NDISEASE)</code></p>
<p>I am sure <code>margins</code> 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 <a href="https://www.stata.com/manuals/rmargins.pdf" rel="nofollow noreferrer">margins</a>.</p>

CC BY-SA 4.0
2022-04-05T18:55:17.533Z
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.
studentp
CC BY-SA 4.0
2022-04-05T19:06:48.533Z
@1190 that’s what the commands after margins should do
1muflon1
CC BY-SA 4.0
2022-04-05T18:33:46.227Z
2022-04-05T18:33:46.227Z
1muflon1
<p>For the logit estimate of the slope parameter,I would like to obtain the marginal effect of the regressor ndisease evaluated at <span class="math-container">$\Lambda (x'\beta)=\bar{y}$</span>, where <span class="math-container">$\bar{y}$</span> is mean of <span class="math-container">$y$</span>.</p>
<p>I obtain the logic estimation as follows:</p>
<p><a href="https://i.sstatic.net/jyWed.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/jyWed.png" alt="enter image description here" /></a></p>
<p>How can I calculate this marginal effect by using Stata?</p>

<econometrics><regression><statistics><self-study><logit>
calculating a marginal effect for logit model
studentp
# calculating a marginal effect for logit model

(Asked by: username_0 on 2022-04-05)

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:

[![enter image description here](https://i.sstatic.net/jyWed.png)](https://i.sstatic.net/jyWed.png)

How can I calculate this marginal effect by using Stata?

**Tags:** econometrics, regression, statistics, self-study, logit

---

## 1 answers

### Answer by username_1 on 2022-04-05. Score: 1

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](https://www.stata.com/manuals/rmargins.pdf).

> **Comments:**
> **username_0**: 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.  
> **username_1**: @1190 that’s what the commands after margins should do  

---

