R/ProbitSimulate.R

Defines functions ProbitSimulate

Documented in ProbitSimulate

ProbitSimulate <- function(beta.vec, X) {
    n <- nrow(X)
    lin.pred <- X%*%beta.vec
    pp <- pnorm(lin.pred)
    UU <- runif(n)
    yy <- rep(0, n)
    yy[UU < pp] <- 1
    return(yy)
}
nchenderson/daarem documentation built on April 1, 2022, 7:37 p.m.