[R] pairwise.t.test: empty p-table

Thomas Hoffmann thomas.hoffmann at uni-bonn.de
Tue May 2 22:29:51 CEST 2006


Thanks,
that was the case.

Thomas :-)


Peter Dalgaard schrieb:
> Thomas Hoffmann <thomas.hoffmann at uni-bonn.de> writes:
>
>   
>> Hi list-members
>>
>> can anybody tell me why
>>
>>  > pairwise.t.test(val, fac)
>>
>> produces an empty p-table. As shown below:
>>
>>
>>         Pairwise comparisons using t tests with pooled SD
>>
>> data:  val and fac
>>
>>        AS AT Fhh Fm Fmk Fmu GBS Gf HFS Hn jAL Kol R_Fill
>> AT     -  -  -   -  -   -   -   -  -   -  -   -   -    
>> Fhh    -  -  -   -  -   -   -   -  -   -  -   -   -    
>> Fm     -  -  -   -  -   -   -   -  -   -  -   -   -    
>> Fmk    -  -  -   -  -   -   -   -  -   -  -   -   -    
>> Fmu    -  -  -   -  -   -   -   -  -   -  -   -   -    
>> GBS    -  -  -   -  -   -   -   -  -   -  -   -   -    
>> Gf     -  -  -   -  -   -   -   -  -   -  -   -   -    
>> HFS    -  -  -   -  -   -   -   -  -   -  -   -   -    
>> Hn     -  -  -   -  -   -   -   -  -   -  -   -   -    
>> jAL    -  -  -   -  -   -   -   -  -   -  -   -   -    
>> Kol    -  -  -   -  -   -   -   -  -   -  -   -   -    
>> R_Fill -  -  -   -  -   -   -   -  -   -  -   -   -    
>> Sa     -  -  -   -  -   -   -   -  -   -  -   -   -    
>>
>> However val and fac do have the same length and are not empty:
>>  > summary(fac)
>>     AS     AT    Fhh     Fm    Fmk    Fmu    GBS     Gf    HFS     Hn    
>> jAL    Kol R_Fill     Sa
>>     50     14      7     35     14     25     59     51     90     
>> 65     12     26     96     26
>>  > summary(val)
>>     Min.  1st Qu.   Median     Mean  3rd Qu.     Max.     NA's
>>   0.0000   0.1744   0.6395   2.1540   1.7440  40.1200 223.0000
>>     
>
> Does table(fac[!is.na(val)]) show any groups with 1 or less
> observations? 
>
> The construction
>
>         s <- tapply(x, g, sd, na.rm = TRUE)
>         n <- tapply(!is.na(x), g, sum)
>         degf <- n - 1
>         total.degf <- sum(degf)
>         pooled.sd <- sqrt(sum(s^2 * degf)/total.degf)
>
> is prone to give NA in such cases.
>
>




More information about the R-help mailing list