You did not provide any code, so it's hard to tell what margins
is doing, since it can do a great number of things. It is good practice to provide code, or--even better--a replicable example. Stata makes this very easy.
My best guess from reading your description is that your margins
is conducting a test that the average predicted probability (with own covariates and setting the factor variable to each value sequentially) is individually zero. This is usually not very meaningful. These predictions use the index coefficients that logit
spits out, multiplied by the covariates and wrapped up inside a logistic()
function.
Here's an example where the outcome is giving birth to low birthweight child and we will predict that as if all mothers are white, then black, and then other, holding age at own values. Then we will repeat what margins
does by hand using a loop for each race:
. webuse lbw, clear
(Hosmer & Lemeshow data)
. qui logit low age i.race
. margins race, post
Predictive margins Number of obs = 189
Model VCE : OIM
Expression : Pr(low), predict()
------------------------------------------------------------------------------
| Delta-method
| Margin Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
race |
white | .2469149 .0446876 5.53 0.000 .1593288 .3345011
black | .4069807 .0961398 4.23 0.000 .2185502 .5954113
other | .3657971 .0585134 6.25 0.000 .251113 .4804812
------------------------------------------------------------------------------
.
. /* Replicate each row of margins */
. forvalues v=1/3 {
2. local race: label race `v'
3. di _newline(1) "`race'"
4. di "z-stat: " %9.2f (_b[`v'.race]-0)/_se[`v'.race]
5. di "p-value: " %9.2f normal(-(_b[`v'.race]-0)/_se[`v'.race])
6. di "95%CI LB: " %9.7f _b[`v'.race]-abs(invnormal(0.025))*_se[`v'.race]
7. di "95%CI UB: " %9.7f _b[`v'.race]+abs(invnormal(0.025))*_se[`v'.race]
8. }
white
z-stat: 5.53
p-value: 0.00
95%CI LB: 0.1593288
95%CI UB: 0.3345011
black
z-stat: 4.23
p-value: 0.00
95%CI LB: 0.2185502
95%CI UB: 0.5954113
other
z-stat: 6.25
p-value: 0.00
95%CI LB: 0.2511130
95%CI UB: 0.4804812
Also, here's what margins
is doing under the hood to get the white prediction of .2469149:
qui logit low age i.race
replace race = 1
predict phat, pr
sum phat