Hi, I've written this function: g = function(test,p1,p2) { test=sort(test) merke=0 for (z in 1:length(test)) { F1=((2*z-1)/length(test)) F21=log(plnorm(test[z],p1,p2)) F22=log(1-plnorm(test[length(test)+1-z],p1,p2)) F2= F21+F22 merke=merke+F1*F2 } return(-length(test)*-merke) } When I call it for e.g. test = 1:10 it only returns ONE value. Instead what I want to have is 10 values (like it makes the dlnorm for instance). I could make that with a loop, but maybe there is there a more simple trick ? Carsten [[alternative HTML version deleted]]