[R] Two questions, first about contingency tables, and second about table () and data.frame (), from a visually impaired user.

2010-03-13 Thread Faiz Rasool
Hi all, I want to make a contingency table in R. I want to tabulate two variables, one as the independent and second as the dependent variable. The IV has two categories, namely, birth complications, and no birth complications. The frequency of birth complication category is fifty, and the

Re: [R] Two questions, first about contingency tables, and second about table () and data.frame (), from a visually impaired user.

2010-03-13 Thread Tal Galili
Oh, That's clearer now. You should use two equal vectors when using table. For example: a - c(a,b,a,b,a,b,a,b) b - c(1,1,1,1,2,2,2,2) table(a,b) also have a look at ?as.table and ?matrix Does that help ? Tal Contact

Re: [R] Two questions, first about contingency tables, and second about table () and data.frame (), from a visually impaired user.

2010-03-13 Thread Joshua Wiley
Dear Faiz, I believe that your basic issue is that you are trying to use frequencies directly. table() needs all the arguments to be of the same length, because it counts the frequencies from raw data. So for two variables, you need pairs of scores indicating whether there was a birth