[R] [ANTISPAM CHU_NANCY] Re: "contingency table" for several variables
David LEVY
d.levy at maternite.chu-nancy.fr
Wed Feb 21 12:26:40 CET 2007
Thank you for your replies,
But xtab(PrettyR) does something different, it computes several tables. Each
table corresponds to a different combination of the levels of the right hand
formula's variables. I only have 3 levels according to my “classification
variable” . I want to gather in a single table the information of chi2 tests
for all the variables I need to test with this classification variable.
> sapply(mydf, function(x) chisq.test(x,classif)$observed)
gives a part of my result : several tables in a single list.
First trick is to gather these tables in a single one and to keep the labels
of the variables and the formats of the levels at the same time. Second
trick is to add the p.value in a nice way.
Must say I didn’t find the tricks so far. I wrote a program but it fails
when meeting empty levels.
About the priority of the count on the percentage, unfortunately, the
decision is not mine.
Thanks
David
More information about the R-help
mailing list