[R] A contingency table of counts by case

Serguei Kaniovski kaniovsk at wifo.ac.at
Tue Jul 18 17:18:27 CEST 2006

Here is an example of the data.frame that I have,


"case" represents the cases,
"id" the persons, and
"x" is the binary state.

I would like to know in how many cases any two persons

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

There will be choose(9,2) sums, denoted s_ij for 1<=i<j<=9,
where i and j are running indices for an "id"-pair.

Please help, this is way beyond my knowledge of R!

Thank you,
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


More information about the R-help mailing list