When we are talk about confouders in statistics, we usually say that the distribution of confounders is not equal in Expousre and Disease and the confounders also correlate with disease and expousre.
It is very easy to simulate confounder's effect in continuous variable and test it by regression by creating a random varaible on confouder and multiply it with plus one error term to get the x and y.
Now, the correlation between X and Y is due to confounder.
However, I am confused when I try to simulate in binary variable.
can everyone shows me how to do it in E, D, and Confounder all are binary variables.