Skip to content

1-pnorm values in a table

2 messages · Jabez Wilson, John Kane

#
This is a bit ugly but I think it works.  
================================================

myf <- function(x) 1-pnorm(x,mean(x), sd(x))
 results  <- apply(test, 2, myf)

mymeans <- apply(test, 2, mean); mymeans

for (i in 1:length(test)){
test[,i][test[,1]>=mymeans[i]]  <- NA
}

results[is.na(test)] <- NA

====================================================
--- Jabez Wilson <jabezwuk at yahoo.co.uk> wrote: