Displaying 1 result from an estimated 1 matches for "add2cmat".
2010 Oct 08
3
Efficiency Question - Nested lapply or nested for loop
...# add 1 to match Gmax range
cmat[Gmax,Gtru] = cmat[Gmax,Gtru] + 1
}
}
## APPROACH 2: Nested lapply ####
# This routine finds the geno w/ highest prob from the erg.avgs.
# and compares it to the true geno. Result is tallied by
# incrementing the appropriate index of the confusion matrix
add2cmat <- function(ind,locus) {
Gmax = which.max(c( data[[paste("G_hat_0_",ind,sep="")]][locus],
data[[paste("G_hat_1_",ind,sep="")]][locus],
data[[paste("G_hat_2_",ind,sep="")]][locus] ))
Gtru = data[[paste("G_",ind...