I'm in a strange situation. I think I can't explain It clearly.
I hope you can give me a hand.
a1=c(1,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) a2=c(1,0,0,1,1,1,1,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) a3=c(1,0,0,1,0,0,0,1,1,0,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) a_total=c(3,0,1,2,1,1,1,1,1,1,1,1,1,3,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) dataz=data.frame(a1,a2,a3,a_total) chiero=as.data.frame(c(20,2,5,3,0,0,3,2)) listX=c("no_values","a1","a2","a3","a1_and_a2","a1_and_a3","a2_and_a3","a1_a2_a3") rownames(chiero)=listX colnames(chiero)="events_" chiero
I sum the columns a1, a2, and a3 in order to produce a_total. But after that, I don't know how to produce the chiero data frame, which count every possible scenario. I mean, I require to produce columns considering every chance of success. Success is considering when one of the columns at least value 1. And I consider the failure when a1 to a3 are zero.
Imagine doing that with 8 or more columns...
Thanks for your help and time.