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

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Wed 03 May 2006 - 06:20:18 EST

Thomas Hoffmann <thomas.hoffmann@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.

-- 
   O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Wed May 03 06:30:50 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 03 May 2006 - 08:10:02 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.