[R] Concurrence Matrix

From: mark salsburg <mark.salsburg_at_gmail.com>
Date: Thu 18 Aug 2005 - 03:25:58 EST


Thank you for all the help.

Can someone refer me to a function that can help with the creation of a concurrence matrix?

I have two asymmetric vectors (C is length 217 and D is length 16063) that contain values of 0,1,2

I want to create a matrix E (where rows are D and columns are C) that ouputs a score where

if C and D are the same number then E has value 1 if C and D are different numbers (i.e. 0 and 1, or 2 and 1) then E has a value 0

so for example:

so if C is c(0,0,2,1,0,0)
and D is c(0,0,1,1,1,1,1,1)

E would look like:

      C 0 0 2 1 0 0

D    0      1  1  0  0  0  0  
      0      1  1  0  0  1  1
      1      0  0  0  1  0  0
      1      0  0  0  1  0  0
      1      0  0  0  1  0  0 
      1      0  0  0  1  0  0
      1      0  0  0  1  0  0 
      1      0  0  0  1  0  0

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Aug 18 03:30:18 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:39:50 EST