[R] Analisys in Multidimensional contingency tables
José Ignacio Bustos Melo
jbustosm at udec.cl
Wed Jun 10 18:40:34 CEST 2009
Dear R-list,
Hi everyone, Im trying to make an analysis of multidimensional contingency
tables using R. I' working with the Agresti example where you have the
data from 3 categories. The thing is how can I do the analisys using the
G2 statistics. Somebody can send me an Idea?
I attach the program where you can find the data.
Best Regards,
> 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 white white yes 19
2 white white no 132
3 white black yes 11
4 white black no 52
5 black white yes 0
6 black white no 9
7 black black yes 6
8 black black no 97
> ftable(xtabs(count ~ victim + perp + death, data = prob1))
death no yes
victim perp
black black 97 6
white 9 0
white black 52 11
white 132 19
>
O__ ---- José Bustos Melo.
c/ /'_ --- Master in Applied Statistics
(*) \(*) -- B.S. in Marine Biology
-------------Science Faculty
-------------Catholic University of Concepcion
-------------Alonso de Ribera 2850 Concepción, Casilla 297
-------------Cell phone: +56 9 9 5939144
More information about the R-help
mailing list