R/calc_mcse_binom.R

Defines functions calc_mcse_binom

calc_mcse_binom <- function(p, B){
  stopifnot(is.numeric(unlist(p)), all(unlist(p) >= 0), all(unlist(p) <= 1),
            is.integer(B))
  lapply(p, function(x) if(any(x == 0:1)) NA_real_ else sqrt(x*(1-x)/B))
}

Try the distfreereg package in your browser

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

distfreereg documentation built on April 4, 2025, 12:30 a.m.