Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: -binreg-


From   Jose Maria <jmpsouza@usp.br>
To   statalist@hsphsun2.harvard.edu
Subject   st: -binreg-
Date   Thu, 15 Apr 2004 23:21:03 -0300

here are some results I got trying -binreg- and -poisson- for a simple data set I concocted. It is not a mathematical demonstration but I think it illustrates the binreg thread.
Excuse me for the long message. I hope I am not offending the netiquette of the Statalist.
Variable -regiao- is categorical alwais.
Variable -mes- is continuous and also catgorical.
Variable -intr- is the response, binomial 0|1.
Summary of the results:
1. -binreg- converges slowly for regiao and mes as categorical in the same model.
2. -binreg- converges for mes as continuous.
2. -binreg- does not converge even using observed initial values (-mean-), when using regiao and mes as continuous, in the same model.
3. -poisson- and -binreg- give the same results only when using just one variable, either regiao or mes as categorical.
4. -poisson- and -binreg- dont give the same results for mes as continuous.

. table regiao intr mes, c(freq) scol
-----------------------------------------------------------------------------------
| mes and intr | ---- 1 --- ---- 2 --- ---- 3 --- ---- 4 --- Total
regiao | 0 1 0 1 0 1 0 1 0 1
----------+-----------------------------------------------------------------------
1 | 9 1 4 6 6 4 12 28 31 39
2 | 8 2 10 10 4 6 2 8 24 26
3 | 5 5 3 7 3 27 1 9 12 48
------------------------------------------------------------------------------------


table regiao mes, c(mean intr) scol
----------------------------------
| mes regiao | 1 2 3 4
------------+-----------------------
1 | .1 .6 .4 .7
2 | .2 .5 .6 .8
3 | .5 .7 .9 .9
----------------------------------

binreg intr regiao2 regiao3 mes2 mes3 mes4, rr
Iteration 21 : deviance = 201.7657
Iteration 22 : deviance = 201.7657

Bernoulli distribution, log link
------------------------------------------------------------------------------
| EIM
intr | Risk Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
regiao2 | 1.065293 .1719628 0.39 0.695 .7763643 1.461748
regiao3 | 1.438657 .1637452 3.20 0.001 1.150999 1.798206
mes2 | 2.122718 .6850225 2.33 0.020 1.127719 3.995615
mes3 | 2.577433 .7841237 3.11 0.002 1.419807 4.678919
mes4 | 2.794085 .8435527 3.40 0.001 1.546167 5.049205
------------------------------------------------------------------------------

. binreg intr regiao2 regiao3 mes2 mes3 mes4,rr robust
Iteration 21 : deviance = 201.7657
Iteration 22 : deviance = 201.7657

Bernoulli distribution, log link
------------------------------------------------------------------------------
| Semi-Robust
intr | Risk Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
regiao2 | 1.065293 .168842 0.40 0.690 .7808348 1.453379
regiao3 | 1.438657 .1762779 2.97 0.003 1.131514 1.829172
mes2 | 2.122718 .6764099 2.36 0.018 1.136722 3.963966
mes3 | 2.577433 .7740788 3.15 0.002 1.430694 4.643316
mes4 | 2.794085 .835674 3.44 0.001 1.554735 5.021376
------------------------------------------------------------------------------

. poisson intr regiao2 regiao3 mes2 mes3 mes4, irr robust
Iteration 1: log pseudo-likelihood = -158.10086 Iteration 2: log pseudo-likelihood = -158.10086
------------------------------------------------------------------------------
| Robust
intr | IRR Std. Err. z P>|z| [95% Conf. Interval]
--------- -----+----------------------------------------------------------------
regiao2 | 1.097472 .1829677 0.56 0.577 .7915592 1.521611
regiao3 | 1.625434 .2213495 3.57 0.000 1.244668 2.122681
mes2 | 2.220439 .7123911 2.49 0.013 1.183981 4.164211
mes3 | 2.469028 .7556734 2.95 0.003 1.355209 4.498272
mes4 | 3.114924 .9294332 3.81 0.000 1.735663 5.590229
------------------------------------------------------------------------------

binreg intr regiao2 regiao3 mes , rr init(mean)
Iteration 1 : deviance = 235.8188
Iteration 2 : deviance = 207.8073

Iteration 48 : deviance = 208.0528
Iteration 49 : deviance = 234.8689
Iteration 50 : deviance = 208.0385
convergence not achieved


poisson intr regiao2 regiao3 mes, irr robust
Iteration 0: log pseudo-likelihood = -158.97054 Iteration 1: log pseudo-likelihood = -158.97052 Iteration 2: log pseudo-likelihood = -158.97052 -----------------------------------------------------------------------------
| Robust
intr | IRR Std. Err. z P>|z| [95% Conf. Interval]
---------------+----------------------------------------------------------------
regiao2 | 1.164876 .1934971 0.92 0.358 .8411761 1.613141
regiao3 | 1.672383 .2052013 4.19 0.000 1.314902 2.127052
mes | 1.341542 .0864462 4.56 0.000 1.182373 1.522138
------------------------------------------------------------------------------


binreg intr regiao2 regiao3 , rr robust
Iteration 1 : deviance = 325.1767
Iteration 5 : deviance = 225.4073
Bernoulli distribution, log link
------------------------------------------------------------------------------
| Semi-Robust
intr | Risk Ratio Std. Err. z P>|z| [95% Conf. Interval]
---------------+----------------------------------------------------------------
regiao2 | .9333333 .1616134 -0.40 0.690 .6647297 1.310474
regiao3 | 1.435897 .1793935 2.90 0.004 1.124032 1.83429
------------------------------------------------------------------------------

. poisson intr regiao2 regiao3 , irr robust
Iteration 0: log pseudo-likelihood = -163.52539 Iteration 1: log pseudo-likelihood = -163.52539
------------------------------------------------------------------------------
| Robust
intr | IRR Std. Err. z P>|z| [95% Conf. Interval]
---------------+----------------------------------------------------------------
regiao2 | .9333333 .1616134 -0.40 0.690 .6647297 1.310474
regiao3 | 1.435897 .1793935 2.90 0.004 1.124032 1.83429
------------------------------------------------------------------------------

binreg intr mes2 mes3 mes4,rr robust
Iteration 6 : deviance = 214.1292
Bernoulli distribution, log link
------------------------------------------------------------------------------
| Semi-Robust
intr | Risk Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
mes2 | 2.15625 .7176143 2.31 0.021 1.123087 4.13985
mes3 | 2.775 .8742133 3.24 0.001 1.496606 5.145393
mes4 | 2.8125 .8793971 3.31 0.001 1.523854 5.190887
------------------------------------------------------------------------------

. poisson intr mes2 mes3 mes4,irr robust Iteration 2: log pseudo-likelihood = -160.38849 ------------------------------------------------------------------------------
| Robust
intr | IRR Std. Err. z P>|z| [95% Conf. Interval]
- ------------+----------------------------------------------------------------
mes2 | 2.15625 .7176142 2.31 0.021 1.123087 4.13985
mes3 | 2.775 .8742132 3.24 0.001 1.496606 5.145393
mes4 | 2.8125 .879397 3.31 0.001 1.523854 5.190886
------------------------------------------------------------------------------


poisson intr mes,irr robust
Iteration 0: log pseudo-likelihood = -161.81962 Iteration 1: log pseudo-likelihood = -161.81962 ------------------------------------------------------------------------------
| Robust
intr | IRR Std. Err. z P>|z| [95% Conf. Interval]
--------------+----------------------------------------------------------------
mes | 1.283088 .0771581 4.15 0.000 1.140433 1.443588
------------------------------------------------------------------------------

binreg intr mes,rr robust
Iteration 7 : deviance = 220.5331
Bernoulli distribution, log link
------------------------------------------------------------------------------
| Semi-Robust
intr | Risk Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
mes | 1.23469 .0708729 3.67 0.000 1.10331 1.381713
------------------------------------------------------------------------------

Cheers,
Jose Maria

- Jose Maria Pacheco de Souza, Professor Titular
Departamento de Epidemiologia
Faculdade de Saude Publica/Universidade de Sao Paulo
Av. Dr. Arnaldo, 715 cep 01246-904
Sao Paulo Brasil
fones (11)3082-3886 (11)3714-2403 (11)3768-8612
fax (11)3082-2920 (11)3714-2403
www.fsp.usp.br/~jmpsouza
jmpsouza@usp.br




*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index