[R] test for equal distributions with small numbes of observations

kjetil brinchmann halvorsen kjetil at entelnet.bo
Wed Aug 20 04:49:35 CEST 2003


On 19 Aug 2003 at 10:15, Christoph Lehmann wrote:

> Dear R-pros
> 
> I have a problem, for which usually I would apply a chisq.test or a
> fisher.test:
> 

try 
?chisq.test

which tells you you can say 
chisq.test(..., sim=TRUE, B=20000)

and the simulation will be very fast!

Kjetil Halvorsen

> 
> 
> 40 objects, each given either a "0" or "1", regarding if this object
> later on will be remembered by a subject or not.
> 
> 7 subjects investigated
> 
> means: we have a 2x40 matrix, each cell the number of subjects for who
> the object i has been given either "0" or "1" e.g.
> 
> objects:
> 	1	1	3		39	40
> 	------------------------------------------
> "0"	1	2	2	..	7	7
> "1"	4	4	5	..	0	0
> 
> over all 40 objects, we have 67% of "1" and 33% of "0"
> 
> I want to know, if for the 40 objects, the ratio of "0"/"1" differs or
> not, i.e. if they have the same distribution.
> 
> I cannot use a chisq.test since the expected frequencies are < 5 for the
> "0" cells.
> 
> Fisher.test seems to run for > 12h on a PIV 1.8GHz...
> 
> what do you recommend me to do?
> 
> Many thanks
> 
> Christoph
> --
> > recognition
>      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
> [1,]    1    2    2    2    2    3    3    3    3     3     3     3     4     4
> [2,]    4    4    5    4    4    3    4    4    4     4     3     4     3     3
>      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26]
> [1,]     4     4     4     4     4     4     5     5     5     5     5     5
> [2,]     3     2     3     3     2     3     2     2     2     2     2     2
>      [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38]
> [1,]     5     5     5     5     5     6     6     6     6     6     6     6
> [2,]     2     2     2     2     2     1     1     1     1     1     1     1
>      [,39] [,40]
> [1,]     7     7
> [2,]     0     0
> 
> > fisher.test(recognition)
> 
> 
> -- 
> Christoph Lehmann <christoph.lehmann at gmx.ch>
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list