R/mice.impute.sample.R

Defines functions mice.impute.sample

mice.impute.sample <- function(y, ry, x = NULL, wy = NULL, ...)
{
  if (is.null(wy)) 
    wy <- !ry
  yry <- y[ry]
  if (length(yry) < 1) 
    return(rnorm(sum(wy)))
  if (length(yry) == 1) yry <- rep(yry, 2)
  return(sample(yry, size = sum(wy), replace = TRUE))
}

Try the mudfold package in your browser

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

mudfold documentation built on Nov. 24, 2022, 5:09 p.m.