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)
}

Try the daarem package in your browser

Any scripts or data that you put into this service are public.

daarem documentation built on March 23, 2022, 9:06 a.m.