Re: [R] Multidimensional contingency tables

2008-04-23 Thread Giovanni Petris
It seems to me that a combination of ftable and xtabs works fine: > prob1<- data.frame(victim=c(rep('white',4),rep('black',4)), + perp=c(rep('white',2),rep('black',2),rep('white',2),rep('black',2)), + death=rep(c('yes','no'),4), count=c(19,132,11,52,0,9,6,97)) > prob1 victim perp death count 1

Re: [R] Multidimensional contingency tables

2008-04-22 Thread hadley wickham
On Tue, Apr 22, 2008 at 8:24 AM, hadley wickham <[EMAIL PROTECTED]> wrote: > On Mon, Apr 21, 2008 at 9:46 PM, Robert A. LaBudde <[EMAIL PROTECTED]> wrote: > > How does one ideally handle and display multidimenstional contingency > > tables in R v. 2.6.2? > > > > E.g.: > > > > > prob1<- da

Re: [R] Multidimensional contingency tables

2008-04-22 Thread hadley wickham
On Mon, Apr 21, 2008 at 9:46 PM, Robert A. LaBudde <[EMAIL PROTECTED]> wrote: > How does one ideally handle and display multidimenstional contingency > tables in R v. 2.6.2? > > E.g.: > > > prob1<- data.frame(victim=c(rep('white',4),rep('black',4)), > + perp=c(rep('white',2),rep('black',2),r

Re: [R] Multidimensional contingency tables

2008-04-21 Thread Robert A LaBudde
Now that is simple and elegant. Thanks! PS. Is there a course available for learning how to read R help information? :) At 10:52 PM 4/21/2008, Gabor Grothendieck wrote: > xtabs(count ~., prob1) > >On Mon, Apr 21, 2008 at 10:46 PM, Robert A. LaBudde <[EMAIL PROTECTED]> wrote: > > How does one ide

Re: [R] Multidimensional contingency tables

2008-04-21 Thread Gabor Grothendieck
xtabs(count ~., prob1) On Mon, Apr 21, 2008 at 10:46 PM, Robert A. LaBudde <[EMAIL PROTECTED]> wrote: > How does one ideally handle and display multidimenstional contingency > tables in R v. 2.6.2? > > E.g.: > > > prob1<- data.frame(victim=c(rep('white',4),rep('black',4)), > + perp=c(rep('whit

[R] Multidimensional contingency tables

2008-04-21 Thread Robert A. LaBudde
How does one ideally handle and display multidimenstional contingency tables in R v. 2.6.2? E.g.: > prob1<- data.frame(victim=c(rep('white',4),rep('black',4)), + perp=c(rep('white',2),rep('black',2),rep('white',2),rep('black',2)), + death=rep(c('yes','no'),4), count=c(19,132,11,52,0,9,6,97)