Skip to content
Prev 59636 / 398502 Next

number of pairwise present data in matrix with missings

Hi Andreas,

maybe something like this could do it:

mat <- sample(0:3, 20*2, TRUE); dim(mat) <- c(20,2)
mat[sample(1:20, 4),] <- NA
########
mat
sum(rowMeans(mat)==mat[,1], na.rm=TRUE)


I hope it helps.

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat
     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "Andreas Wolf" <andreas.wolf at uni-jena.de>
To: <r-help at stat.math.ethz.ch>
Sent: Tuesday, November 23, 2004 2:42 PM
Subject: [R] number of pairwise present data in matrix with missings