ycondx <- data.table::data.table(y =rep(c(0,1), each = 3), x=rep(1:3, 2),
prob = c(0.2,0.6,0.1,0.8,0.4,0.9))
x <- data.table::data.table(x = sample(1:3, 20, replace = TRUE),
uy = stats::runif(20), uy2 = stats::runif(20))
generate_condprob(ycondx, x, Umerge_expr = "(uy+uy2)/2")
Run the code above in your browser using DataLab