Re: [R] Three-dimensional contingency table

2010-08-29 Thread David Winsemius
On Aug 28, 2010, at 10:58 PM, Randklev, Charles wrote: Hi, I am trying to assemble a three-way contingency table examining the presence/absence of mussels, water depth (Depth1 and Depth 2) and water velocity (Flow vs. No Flow). I have written the following code listed below; however, whe

Re: [R] Three-dimensional contingency table

2010-08-29 Thread Cheng Peng
I didn't see any error when I ran your code in my computer: > numbers <- c(1134,956,328,529,435,599,27,99) > dim(numbers) <- c(2,2,2) > numbers , , 1 [,1] [,2] [1,] 1134 328 [2,] 956 529 , , 2 [,1] [,2] [1,] 435 27 [2,] 599 99 > dimnames(numbers)[[3]] <-list("Mussels", "

Re: [R] Three-dimensional contingency table

2010-08-29 Thread Ista Zahn
Hi, Your example works fine for me. My guess is that you have one of wd, wv, MP, or Count defined as a global variable. This is the main reason the use of attach() is discouraged by many people on this list. The safer thing to do is model1 <- glm(Count~MP+wd+wv,poisson. data = frame) -Ista On Sat

[R] Three-dimensional contingency table

2010-08-28 Thread Randklev, Charles
Hi, I am trying to assemble a three-way contingency table examining the presence/absence of mussels, water depth (Depth1 and Depth 2) and water velocity (Flow vs. No Flow). I have written the following code listed below; however, when run the glm I get the following message, "Error in model.fr