Skip to content

cumulative sum by group and under some criteria

1 message · arun

#
The values of 'x' an 'm' from res2.? For more information, you can check ?rbeta.
I also don't get what you are up to.
If you want to create 1000 random samples for each combinations of x, m
?lapply(lapply(unique(apply(cbind(res2$x,res2$m),1,paste,collapse="")),function(i) as.numeric(unlist(strsplit(i,"")))),function(x) rbeta(1000,0.2+x[1],0.8+x[2]-x[1]))

A.K.