[R] Transformation for -ve binomial data

Ben Bolker bolker at ufl.edu
Thu Sep 25 15:12:44 CEST 2008


Georgina Sarah Humphreys <g.humphreys.1 <at> research.gla.ac.uk> writes:

> 
> Can anyone advise a good transformation for this data below to produce a
normalised distribution?
> 
> Many thanks,
> Georgina
> 
>

  Depending on how "normal" you want it to be, this may be
impossible because about a third of your data set (14/47)
has the same value (1).  There's no transformation that
can spread out a peak consisting of identical values.

d <- c(1,12,1,12,6,17,54,1,12,2,22,27,1,27,1,
  1,6,24,10,54,12,5,27,68,1,4,6,27,
  1,1,1,1,68,1,7,1,10,5,4,1,7,9,3,19,22,10,4)
table(d)

> table(d)
d
 1  2  3  4  5  6  7  9 10 12 17 19 22 24 27 54 68 
14  1  1  3  2  3  2  1  3  4  1  1  2  1  4  2  2 

Naively, the Box-Cox transformation says you should
be using a log transformation (lambda=0)

library(MASS)
boxcox(d~1)

  good luck,
   Ben Bolker



More information about the R-help mailing list