[R] using "cochran.test()" as a "mcnemar.test()" ?

Chuck Cleland ccleland at optonline.net
Mon Jun 1 23:56:46 CEST 2009


On 6/1/2009 5:29 PM, Tal Galili wrote:
> Hello all
> I wish to perform a mcnemar.test() for a 5X5 matrix.
> Wikipedia tells me (http://en.wikipedia.org/wiki/Cochran_test) I should turn
> to cochran.test.
> The only place I found it was in the "outliers" package, but the command
> cochran.test() acts differently then  mcnemar.test() , and doesn't take a
> table as input.
> 
> Any ideas on how to use it ? 
> 
> #Example code:
> aa =
> as.table(matrix(c(0,0,0,0,1,0,2,2,1,0,1,2,2,1,0,1,1,3,2,0,0,0,1,2,3),5,5))
> mcnemar.test(aa)
> #  p-value = NA
> install.packages("outliers")
> require(outliers)
> cochran.test(aa)
> # Error in x$terms : $ operator is invalid for atomic vectors
> 
> Thanks,
> Tal 

  I'm not sure you actually want Cochran's Q Test, but if you do see
this thread:

https://stat.ethz.ch/pipermail/r-help/2006-September/113139.html

-- 
Chuck Cleland, Ph.D.
NDRI, Inc. (www.ndri.org)
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894




More information about the R-help mailing list