R/mice_multilevel_draw_binomial.R

Defines functions mice_multilevel_draw_binomial

## File Name: mice_multilevel_draw_binomial.R
## File Version: 0.05

########################################################################
# draw binomial data
mice_multilevel_draw_binomial <- function( probs ){
    N <- length(probs)
    rn <- stats::runif(N, 0, 1)
    res <- 1*(rn < probs)
    return(res)
}

Try the miceadds package in your browser

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

miceadds documentation built on May 29, 2024, 11:05 a.m.