[R] Can I test if there are statistical significance between

(Ted Harding) ted.harding at nessie.mcc.ac.uk
Sat Jul 21 15:51:55 CEST 2007


On 21-Jul-07 12:46:46, zhijie zhang wrote:
> Dear Uwe Ligges,
[restructuring the given layout of the data]


        Grp1  Grp2        Grp3
Better   16     0  [  1]    1  |  17
                               |
Good     71     4  [ 10]    6  |  81
                               |
Bad      37    61  [118]   57  | 155
-------------------------------+-----
        124    65  [129]   64  | 253

> My hypothesis is if the three groups,that is group1, group2,and
> group3, have the same distributions on coloumns? If not, which
> one is difference from which one?

It is clear that there is no discernible difference between
Group 2 and Group 3. If they are pooled together (totals in
[...] above), it is also clear that there is a very large
difference between [Group 2 + Group 3], or either separately,
and Group 1.

In summary, and in round figures, Groups 2 and 3 have about
90% "Bad", about 10% "Good" and hardly any "Better".

Group 1 has only about 30% "Bad", about 60% "Good", and 10%
"Better".

Formally:

A<-cbind(c(16,71,37),c(1,10,118))
A
       [,1] [,2]
  [1,]   16    1
  [2,]   71   10
  [3,]   37  118

chisq.test(A)
  Pearson's Chi-squared test
  data:  A
  X-squared = 101.4434, df = 2, p-value = < 2.2e-16

cbind(round(chisq.test(A)$expected,1),A)
       [,1] [,2]    [,3] [,4]
  [1,]  8.3  8.7      16    1
  [2,] 39.7 41.3      71   10
  [3,] 76.0 79.0      37  118


B<-cbind(c(0,4,61),c(1,6,57))
B
       [,1] [,2]
  [1,]    0    1
  [2,]    4    6
  [3,]   61   57

chisq.test(B,simulate.p.value=TRUE)
  Pearson's Chi-squared test with simulated p-value
  (based on 2000 replicates)
  data:  B 
  X-squared = 1.5279, df = NA, p-value = 0.3215

fisher.test(B)
  Fisher's Exact Test for Count Data
  data:  B 
  p-value = 0.4247
  alternative hypothesis: two.sided 

That, with possible refinements for more careful statements
about the proportions in the three outcome classes, is about
all one can say about these data; and it is definite enough!

With the totally non-committal P-value for Group 2 vs Group 3,
and the absolutely decisive P-value for Group 1 vs Groups 2&3,
there is no need whatever to bother with "multiple comparison"
complications.

Best wishes,
Ted.


> On 7/20/07, Uwe Ligges <ligges at statistik.uni-dortmund.de> wrote:
>>
>>
>>
>> zhijie zhang wrote:
>> > Dear  friends,
>> >   My R*C table is as follow:
>> >
>> >
>> >
>> > better
>> >
>> > good
>> >
>> > bad
>> >
>> > Goup1
>> >
>> > 16
>> >
>> > 71
>> >
>> > 37
>> >
>> > Group2
>> >
>> > 0
>> >
>> > 4
>> >
>> > 61
>> >
>> > Group3
>> >
>> > 1
>> >
>> > 6
>> >
>> > 57
>> >
>> >    Can I test if there are statistical significant between Group1
>> >    and
>> > Group2, Group2 and Group3, Group1 and Group2, taking into the
>> > multiple
>> > comparisons?
>>
>>
>> So what is you hypothesis? Statistical significance of what it to be
>> tested?
>>
>> Uwe Ligges
>>
>>
>>
>> > The table can be set up using the following program:
>> >
>> > a<-matrix(data=c(16,71,37,0,4,61,1,6,57),nrow=3,byrow=TRUE)
>> > Thanks very much.
>> >
>> >
>>
> 
> 
> 
> -- 
> With Kind Regards,
> 
> oooO:::::::::
> (..):::::::::
>:\.(:::Oooo::
>::\_)::(..)::
>:::::::)./:::
>::::::(_/::::
>:::::::::::::
> [***********************************************************************
> ]
> Zhi Jie,Zhang ,PHD
> Tel:86-21-54237149
> Dept. of Epidemiology,School of Public Health,Fudan University
> Address:No. 138 Yi Xue Yuan Road,Shanghai,China
> Postcode:200032
> Email:epistat at gmail.com
> Website: www.statABC.com
> [***********************************************************************
> ]
> oooO:::::::::
> (..):::::::::
> :\.(:::Oooo::
> ::\_)::(..)::
> :::::::)./:::
> ::::::(_/::::
> :::::::::::::

--------------------------------------------------------------------
E-Mail: (Ted Harding) <ted.harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 21-Jul-07                                       Time: 14:51:46
------------------------------ XFMail ------------------------------



More information about the R-help mailing list