Statalist The Stata Listserver


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

R: st: inference on counts?


From   "Carlo Lazzaro" <[email protected]>
To   <[email protected]>
Subject   R: st: inference on counts?
Date   Wed, 30 May 2007 23:14:53 +0200

Dear Svend,

thanks a lot for Your Kindness, Time and helping hints.

I beg Your pardon for my late thanking You, but I was unable to scan the
e-mails this afternoon.

Kind Regards,

Carlo

-----Messaggio originale-----
Da: [email protected]
[mailto:[email protected]] Per conto di Svend Juul
Inviato: mercoled� 30 maggio 2007 14.52
A: [email protected]
Oggetto: Re: st: inference on counts? 

Carlo wrote:

I would like to compare with Stata 9/2SE two samples (SDO 2003 vs. SDO
2004)
of discharge diagnoses Diagnosis Related Groups (DRG)codes and check for
the
significance of the reduction occurred in inpatient hospitalizations
(RO)
during 2003 ( 835,158) - 2004 (775,287).

As these data seem counts, I supposed they have something to deal with
Poisson distribution, but I would kindly ask You all for some hints on
this
issue.

DRG codes					RO - SDO 2003    RO -
SDO 2004
6						16,084		13,763
39						116,574		95,355
40						15,258            14,870

119                                53,483             51,385 
134                                54,674              50,981 
162                                87,517              80,981
183                                134,501             124,971    	
222                                98,794              94,024	
270                                20,993              20,719 
284                                27,327              24,836
294                                39,715             37,320
301                                 24,453              22,264
364                                 38,591              33,639
395                                  43,887           42,530
467                                 63,307            67,649 

Total                               835,158            775,287

--------------------------------------------------------

Provided the population at risk has the same size in 2003 and 2004
you may compare incidence rates, arbitrarily setting the time at
risk to 1 (or any other number you like, it does not matter).

-ir- (see [ST] epitab) estimates incidence rate ratios.

clear
input drg n0 n1
6    16084  13763
39   116574 95355
40   15258  14870 
119  53483  51385 
134  54674  50981 
162  87517  80981
183  134501 124971  	
222  98794  94024	
270  20993  20719 
284  27327  24836
294  39715  37320
301  24453  22264
364  38591  33639
395  43887  42530
467  63307  67649 
end

reshape long n , i(drg) j(year)
generate t=1

ir n year t , by(drg)

             drg |      IRR       [95% Conf. Interval]   M-H Weight
-----------------+-------------------------------------------------
               6 |   .8556951        .83638   .8754475         8042
(exact)
              39 |   .8179783      .8109994   .8250157        58287
(exact)
              40 |   .9745707      .9527422   .9968977         7629
(exact)
             119 |   .9607726       .949192   .9724938      26741.5
(exact)
             134 |   .9324542      .9212518   .9437915        27337
(exact)
             162 |   .9253174      .9165052   .9342134      43758.5
(exact)
             183 |   .9291455      .9220106   .9363351      67250.5
(exact)
             222 |   .9517177       .943247   .9602641        49397
(exact)
             270 |    .986948      .9681388   1.006122      10496.5
(exact)
             284 |   .9088447      .8933258   .9246301      13663.5
(exact)
             294 |   .9396953      .9264859   .9530916      19857.5
(exact)
             301 |   .9104813      .8940598   .9272009      12226.5
(exact)
             364 |   .8716799      .8590033   .8845404      19295.5
(exact)
             395 |   .9690797      .9562192   .9821125      21943.5
(exact)
             467 |   1.068586      1.057052   1.080248      31653.5
(exact)
-----------------+-------------------------------------------------
           Crude |   .9283118      .9254456   .9311868
(exact)
    M-H combined |   .9283118      .9254467   .9311857
-------------------------------------------------------------------
 Test of homogeneity (M-H)    chi2(14) =   1779.56  Pr>chi2 = 0.0000

The IRR estimates are the incidence rate ratios (2004/2003).

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: +45 8942 6090
Home:  +45 8693 7796
Email: [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