Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mu1 <- 0
- mu2 <- 1
- sd1 <- 1
- sd2 <- 3
- N <- 10^4
- z <- rnorm(N, mean = mu1, sd = sd1) + rnorm(N, mean = mu2, sd = sd2)
- x <- rbinom(N, size = 1, prob = exp(z)/(exp(z)+1))
- u <- exp(z)
- y <- rbinom(N, size = 1, prob = u/(u+1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement