Dear r users, I have 4 variables x1,x2,x3,x4 and each one has two levels, for example Y and N.
For x1: prob(Y)=0.6, prob(N)=0.4; For x2: prob(Y)=0.5, prob(N)=0.5; For x3: prob(Y)=0.8, prob(N)=0.2; For x4: prob(Y)=0.9, prob(N)=0.1; Therefore, the sample space for (x1, x2, x3, x4)={YYYY, YYYN, YYNY,......} (16 possible combination) and the corresponding probabilities are {(0.6)(0.5)(0.8)(0.9), (0.6)(0.5)(0.8)(0.1), (0.6)(0.5)(0.2)(0.9),...} I want to create a matrix includes all possible outcomes and the corresponding probabilities. That is A= YYYY (0.6)(0.5)(0.8)(0.9) YYYN (0.6)(0.5)(0.8)(0.1) YYNY (0.6)(0.5)(0.2)(0.9) . . . . . . Any efficient way to do this? Thanks, Kate [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.