webuse bangladesh, clear
melogit c_use
------------------------------------------------------------------------------
c_use | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_cons | -.4370216 .0465681 -9.38 0.000 -.5282934 -.3457499
------------------------------------------------------------------------------
ß0 =_const= -.4370216 = exp(-.4370216)/(1+exp(-.4370216))= .39245089 = the prob of c_use in this population to confirm: ``` . tab c_use
Use |
contracepti | on | Freq. Percent Cum. ————+———————————– no | 1,175 60.75 60.75 yes | 759 39.25 100.00 ————+———————————– Total | 1,934 100.00
## Fixed-effects model with one single binary predictor
c_use | Coef. Std. Err. z P>|z| [95% Conf. Interval]
————-+—————————————————————- urban | .7191986 .1018055 7.06 0.000 .5196635 .9187338
- model: logit(c_use)= ß0 + ß1(urban) + ε
where:
- ß0 = exp(-.6551198)/(1+exp(-.6551198))= .34183673 = the prob of c_use when urban==0
to confirm:
. tab c_use if urban==0
Use |
contracepti |
on | Freq. Percent Cum.
------------+-----------------------------------
no | 903 65.82 65.82
yes | 469 34.18 100.00
------------+-----------------------------------
Total | 1,372 100.00
c_use | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval]
————-+—————————————————————- age | 1.007428 .0052726 1.41 0.157 .9971463 1.017815 urban | 2.059527 .2098625 7.09 0.000 1.686675 2.5148
```