Hi Stata Users
It seems simple but I have a question on how to manually calculate the marginal effects at mean for logit model. So basically I need to replicate the results of the output I obtained when I used margins, dydx (*) atmeans using a manual method (in other words, I need to replicate the red colored numbers using a manual method). I tried several things but couldn't replicate it. My continuous variables are gre and gpa and the categorical variable is rank. The dataset is attached
use binary
qui logit admit gre gpa i.rank
margins , dydx(*) atmeans
The output is given below
. qui logit admit gre gpa i.rank
. margins , dydx(*) atmeans
Conditional marginal effects Number of obs = 400
Model VCE : OIM
Expression : Pr(admit), predict()
dy/dx w.r.t. : gre gpa 2.rank 3.rank 4.rank
at : gre = 587.7 (mean)
gpa = 3.3899 (mean)
1.rank = .1525 (mean)
2.rank = .3775 (mean)
3.rank = .3025 (mean)
4.rank = .1675 (mean)
------------------------------------------------------------------------------
| Delta-method
| dy/dx Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
gre | .0004743 .0002282 2.08 0.038 .0000271 .0009215
gpa | .1684057 .0691417 2.44 0.015 .0328904 .3039211
|
rank |
2 | -.164317 .0770559 -2.13 0.033 -.3153438 -.0132903
3 | -.2979896 .0761584 -3.91 0.000 -.4472572 -.1487219
4 | -.3319332 .0821748 -4.04 0.000 -.4929928 -.1708735
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
Related Posts with Help with manually calculating marginal effects at mean for logit
SEM mediation analysis - goodness-of-fitDear Statalisters, My dataset is the following: 1 IV (independent variable), which ranges from 1 t…
How to insert multiple values in StataDear Statalist, I have a dataframe like: householdno foodcount foodcode 1 1 67 1 2 65 …
R^2 for Generalized Gamma AFT regressionHello Stata Fam, I want to compare parametric survival models using r2. I have calculated r2 for Exp…
Spearman rank correlationHi, I have tested the correlation between two measures of physical activity (accelerometer versus qu…
Mata function -truish()-Dear All, I occasionally find the function truish() mentioned in other people's code, such as here:…
Subscribe to:
Post Comments (Atom)
0 Response to Help with manually calculating marginal effects at mean for logit
Post a Comment