Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: R: Abnormal logistic results


From   "Carlo Lazzaro" <carlo.lazzaro@tiscalinet.it>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: R: Abnormal logistic results
Date   Mon, 15 Oct 2012 10:26:14 +0200

Dear Ras,
please reports Stata output in order to increase the likelihood to get
helpful hints from the Listers.
As an aside, 89 vs 1 disease events is a very unbalanced result, possibly
unconfortable to manage via logistic regression.
Eventually, just out of curiosity: provided you have the time of eevents
available for both groups of children,  why didn't you consider a parametric
survival model (instead of logistic regression)?
Anyway, please find below the (far from being efficient) Stata code that I
wrote in trying to reproduce your query an, below the last dotted line, the
output I got from Stata 12.1/SE (but I don't think that the release is
relevant in this instance).

Kindest Regards,
Carlo
............................................................................
......................................
set obs 12247
g Children_Group=0 in 1/6168
replace Children_Group=1 if Children_Group==.
g Disease=1 in 1/89
replace Disease=1 in 12200
replace Disease=0 if Disease==.
g Drug=1 in 1
replace Drug=1 in 2077
replace Drug=0 if Drug==.
g Mom_age="20-25" in 1/2000
replace Mom_age="26-30" in 2001/4000
replace Mom_age="31-35" in 4001/6000
replace Mom_age="36-40" in 6001/8000
replace Mom_age="41-42" in 8001/12247
g Kid_age="1-2" in 1/2000
replace Kid_age="3-4" in 2001/4000
replace Kid_age="5-6" in 4001/6000
replace Kid_age="7-8" in 6001/8000
replace Kid_age="9-10" in 8001/12247
encode Mom_age, generate(Mom_age_2)
encode Kid_age, generate(Kid_age_2)
xi:logistic Disease i.Children_Group i.Drug i.Mom_age_2 i.Kid_age_2, or
............................................................................
......................................
i.Children_Gr~p   _IChildren__0-1     (naturally coded; _IChildren__0
omitted)
i.Drug            _IDrug_0-1          (naturally coded; _IDrug_0 omitted)
i.Mom_age_2       _IMom_age_2_1-5     (naturally coded; _IMom_age_2_1
omitted)
i.Kid_age_2       _IKid_age_2_1-5     (naturally coded; _IKid_age_2_1
omitted)
note: _IMom_age_2_2 != 0 predicts failure perfectly
      _IMom_age_2_2 dropped and 2000 obs not used

note: _IDrug_1 != 0 predicts success perfectly
      _IDrug_1 dropped and 1 obs not used

note: _IMom_age_2_3 != 0 predicts failure perfectly
      _IMom_age_2_3 dropped and 2000 obs not used

note: _IMom_age_2_4 != 0 predicts failure perfectly
      _IMom_age_2_4 dropped and 2000 obs not used

note: _IMom_age_2_5 omitted because of collinearity
note: _IKid_age_2_2 omitted because of collinearity
note: _IKid_age_2_3 omitted because of collinearity
note: _IKid_age_2_4 omitted because of collinearity
note: _IKid_age_2_5 omitted because of collinearity

Logistic regression                               Number of obs   =
6246
                                                  LR chi2(1)      =
192.98
                                                  Prob > chi2     =
0.0000
Log likelihood = -370.21758                       Pseudo R2       =
0.2067

----------------------------------------------------------------------------
---
      Disease | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf.
Interval]
--------------+-------------------------------------------------------------
---
_IChildren__1 |   .0051144   .0051453    -5.24   0.000      .000712
.0367404
     _IDrug_1 |          1  (omitted)
_IMom_age_2_2 |          1  (omitted)
_IMom_age_2_3 |          1  (omitted)
_IMom_age_2_4 |          1  (omitted)
_IMom_age_2_5 |          1  (omitted)
_IKid_age_2_2 |          1  (omitted)
_IKid_age_2_3 |          1  (omitted)
_IKid_age_2_4 |          1  (omitted)
_IKid_age_2_5 |          1  (omitted)
        _cons |   .0460492   .0050206   -28.23   0.000     .0371893
.0570199
----------------------------------------------------------------------------
---
-----Messaggio originale-----
Da: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Per conto di Ras Dondo
Inviato: lunedì 15 ottobre 2012 04:13
A: statalist
Oggetto: st: Abnormal logistic results

Dear Statalist,
 
I run logistic regression on my data and got an abnormal results and I
wanted to ask for advice on how to rectify the problem. I have a dataset
containing five variables:
1. condition in a child disease (binary 1/0), 2. mother's age (grouped by 5
year intervals), 3. state (12 states), 4. child's year of birth (grouped
into 5 levels), and 5. drug X (binary). My objective was to calculate the OR
and associated 95% CI interval of the baby having the disease when the it
was exposed to drug in X in the womb, adjusting for maternal age, state, and
child's year of birth.
 
I use Stata SE 9.0. I used the following command:
 
xi:logistic disease X i.age i.state i.birth
 
and got OR to be 0 and 95% CI to range from 0-0. 
I had a sample size of 6,168 children of which 89 had the disease with 1
child exposed to the drug, and 6,079 children without the disease with also
1 child exposed to the drug in the womb.
 
Could somebody advise as to what might have gone wrong and whether logistic
regression was the way to go?
 
Thanks
 
Ras

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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