[R] Newbie question on using friedman.test()

From: Bill Kules <wmk_at_takomasoftware.com>
Date: Wed 18 Jan 2006 - 05:16:12 EST


I am trying to use the friedman.test() on a data frame, d, but I am receiving the following error message:

> d

   AW HS IAC WA
1 6 8 3 5
2 2 2 3 6
3 7 7 8 3
4 8 5 4 5
....
20 2 5 2 7
21 7 7 6 7
22 7 8 6 8
23 6 8 4 5
24 5 7 5 2
> friedman.test(d)

Error in any(is.na(groups)) : argument "groups" is missing, with no default

I think I just need to convert the data frame to a matrix, and then friedman.test() will get the roups and blocks automatically.

Question 1) Is my understanding correct?

Question 2) What R function will convert the data frame to the matrix I need?
I'm still figuring out the matrix functions, and I would appreciate any pointers or examples. The help() section is sometimes a bit terse...

Thanks in advance from a Newbie,
Bill

PS - to recreate the above data frame "d": d <-

structure(list(AW = as.integer(c(6, 2, 7, 8, 8, 8, 7, 5, 3, 6, 
8, 7, 6, 4, 8, 7, 8, 7, 7, 2, 7, 7, 6, 5)), HS = as.integer(c(8, 
2, 7, 5, 4, 5, 7, 7, 2, 8, 4, 7, 8, 7, 6, 7, 5, 8, 8, 5, 7, 8, 
8, 7)), IAC = as.integer(c(3, 3, 8, 4, 7, 5, 8, 3, 4, 3, 7, 4, 
6, 5, 6, 7, 8, 6, 8, 2, 6, 6, 4, 5)), WA = as.integer(c(5, 6, 
3, 5, 3, 6, 7, 8, 3, 5, 6, 7, 7, 7, 7, 6, 4, 7, 8, 7, 7, 8, 5, 2))), .Names = c("AW", "HS", "IAC", "WA"), row.names = c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24" ), class = "data.frame")

Bill Kules
Principal, Takoma Software, Inc., Takoma Park, MD   www.takomasoftware.com
Ph.D. Candidate, University of Maryland Human-Computer Interaction Lab   www.cs.umd.edu/hcil

wmk@takomasoftware.com

(301) 405-2725 voice
(301) 891-7271 voice + voicemail
(301) 891-7273 fax
(301) 755-7982 mobile



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 Jan 18 05:28:34 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:05 EST