Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Query for OR calculation


From   "Todd Swarthout" <[email protected]>
To   <[email protected]>
Subject   RE: st: Query for OR calculation
Date   Sat, 21 Apr 2007 09:52:17 +0200

Fantastic...Thank you all so much!!

Todd

-----Message d'origine-----
De : [email protected] [mailto:[email protected]] De la part de Svend Juul
Envoy� : vendredi 20 avril 2007 20:30
� : [email protected]
Objet : Re: st: Query for OR calculation 

Todd wrote:
 
For an HIV programme in Benin we had 59 persons lost to follow-up. 
We were able to do home visits for 41 persons, after which 33 returned to clinical care. Of those 18 we were not able to visit, only 8 returned to clinical care.
 
What is the most efficient way to create a mini database to define the odds ratio...the odds of returning for clinical care after a home visit as compared to those not visited. I could simply go into the Data Editor of a blank database and enter the numbers...
but Id like to type in the data.
    
Visited 41 (33 reintegrated)
Not Visited 18 (8 reintegrated)
Total 59
 
----------------------------------------------------
 
Michael and Sebastian gave valid suggestions. But since you ask for odds ratios, the most direct way is -cci- :
 
. cci 33 8 8 10
                                                         Proportion
                 |   Exposed   Unexposed  |      Total     Exposed
-----------------+------------------------+------------------------
           Cases |        33           8  |         41       0.8049
        Controls |         8          10  |         18       0.4444
-----------------+------------------------+------------------------
           Total |        41          18  |         59       0.6949
                 |                        |
                 |      Point estimate    |    [95% Conf. Interval]
                 |------------------------+------------------------
      Odds ratio |          5.15625       |    1.311065    20.46528 (exact)
 Attr. frac. ex. |         .8060606       |    .2372611    .9511368 (exact)
 Attr. frac. pop |         .6487805       |
                 +-------------------------------------------------
                               chi2(1) =     7.66  Pr>chi2 = 0.0056
 
You could also create your "database" with the -input- command_
 
   clear
   input visit reint n
   0 0 10
   0 1 8
   1 0 8
   1 1 33
   end
 
and use -n- as frequency weight:
 
   cc reint visit [fweight=n]
 
or -expand- the dataset:
 
   expand n
   cc reint visit
 
Hope this helps
Svend
 
 
________________________________________________________ 
 
Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi (Institute of Public Health, Department of Epidemiology) Vennelyst Boulevard 6 DK-8000 Aarhus C,  Denmark Phone, work:  +45 8942 6090 Phone, home:  +45 8693 7796 
Fax:          +45 8613 1580 
E-mail:       [email protected] 
_________________________________________________________ 

*
*   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/

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index