R/ob_counter.r

Defines functions ob_counter

Documented in ob_counter

############################
# observed counterexamples #
############################

#########################################
#                                       # 
# This function computes from a dataset #
# for all item pairs the corresponding  #
# numbers of counterexamples.           #
#                                       # 
#########################################

ob_counter<-function(dataset){
m<-ncol(dataset)
n<-nrow(dataset)
b<-matrix(0,ncol = m, nrow = m)
for(i in 1:m){
for(j in 1:m){
if(i != j) b[i,j]<-sum(dataset[,i] == 0 & dataset[,j] == 1)
}
}
return(b)
}

Try the DAKS package in your browser

Any scripts or data that you put into this service are public.

DAKS documentation built on May 2, 2019, 6:43 a.m.