[R] Compiling a contingency table of counts by case

Serguei Kaniovski kaniovsk at wifo.ac.at
Fri Sep 22 10:44:38 CEST 2006


I have asked a similar question before but this time
the problem is somewhat more involved. I have the
following data:

case;name;x
1;Joe;1
1;Mike;1
1;Zoe;1
2;Joe;1
2;Mike;0
2;Zoe;1
2;John;1
3;Mike;1
3;Zoe;0
3;Karl;0

I would like to count the number of "case"
in which any two "name"

a. both have "x=1",
b. the first has "x=0" - the second has "x=1",
c. the first has "x=1" - the second has "x=0",
d. both have "x=0",

The difficulty is that the number of "names" and their
identity changes from case to case.

Thanks a lot for you help,
Serguei Kaniovski
-- 
___________________________________________________________________

Austrian Institute of Economic Research (WIFO)

Name: Serguei Kaniovski			P.O.Box 91
Tel.: +43-1-7982601-231			Arsenal Objekt 20
Fax:  +43-1-7989386			1103 Vienna, Austria
Mail: Serguei.Kaniovski at wifo.ac.at

http://www.wifo.ac.at/Serguei.Kaniovski



More information about the R-help mailing list