Statalist


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

RE: st: Other definition of -tabodds-?


From   "Tiago V. Pereira" <[email protected]>
To   [email protected]
Subject   RE: st: Other definition of -tabodds-?
Date   Fri, 15 Aug 2008 09:35:11 -0300 (BRT)

Herve,

I believe there is no routine already implemented to run exactly the
analysis you are looking for.

However, the main point in your analysis is to obtain a reliable estimate
of the standard error of that ratio. If you can accomplish this task, you
can apply tests for trend and homogeneity as you just did with -tabodds-
using simple do files. If you need further help, please, do not hesitate
to contact me through private messages.

Cheers!

Tiago

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

Herve wrote:

Dear Statalisters:

I use -tabodds- to compute two ratios (cases/controls) (20/13 and  22/11
in the example below) and test the evolution of these ratios (see the
output below).

tabodds small_profit post_ifrs if country=="AUS" & sample_sum==1

--------------------------------------------------------------------------
 post_ifrs  |      cases     controls       odds      [95% Conf. Interval]
------------+-------------------------------------------------------------
          0 |         20           13    1.53846        0.76531   3.09270
          1 |         22           11    2.00000        0.96985   4.12436
--------------------------------------------------------------------------
Test of homogeneity (equal odds): chi2(1)  =     0.26
                                  Pr>chi2  =   0.6115

Score test for trend of odds:     chi2(1)  =     0.26
                                  Pr>chi2  =   0.6115

I would like to define the ratios in a different way:

Instead of cases/controls, I would like to have:

(cases-controls)/(cases+controls).

With the -matrix- command and scalars, I manage to get the ratios:

count if post_ifrs==0 & small_profit==1 &  country=="AUS" & sample_sum==1
scalar N1 = r(N)
count if post_ifrs==0 & small_profit==0 &  country=="AUS" & sample_sum==1
scalar N2 = r(N)
scalar odds=(N1-N2)/(N1+N2)
matrix m1 = N1, N2, odds
matrix rownames m1 = "Pre IFRS"
count if post_ifrs==1 & small_profit==1 &  country=="AUS" & sample_sum==1
scalar N3 = r(N)
count if post_ifrs==1 & small_profit==0 &  country=="AUS" & sample_sum==1
scalar N4 = r(N)
scalar odds2=(N3-N4)/(N3+N4)
matrix m2 = N3, N4, odds2
matrix rownames m2 = "Post IFRS"
matrix m3 = m1\m2
matrix colnames m3 = "Cases (Small profit)" "Controls (Small loss)" Odds
matrix list m3

Here is the output:

m3[2,3]
            Cases (Small profit)  Controls (Small loss)                  
Odds
 Pre IFRS                     20                     13             
.21212121
Post IFRS                     22                     11             
.33333333


I would like to know if there is an equivalent command to -tabodds- or a
specific way to test the evolution of the two ratios:


(N1-N2)/(N1+N2)
(N3-N4)/(N3+N4)

respectively 0.2121 and 0.3333 in my example.

Best regards

Herve Stolowy





*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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