R/mice.impute.constant.R

Defines functions mice.impute.constant

Documented in mice.impute.constant

## File Name: mice.impute.constant.R
## File Version: 0.03


mice.impute.constant <- function(y, ry, x, fixed_values, ... )
{
    pos <- parent.frame(n=1)
    res <- mice_imputation_get_states(pos=pos)
    vname <- res$vname
    newstate <- res$newstate
    pos <- res$pos
    state_data <- res$data
    fixed_default <- rep(-99, sum(!ry))
    fixed_values <- mice_imputation_extract_list_arguments( micearg=fixed_values,
                        vname=vname, miceargdefault=fixed_default)
    yimp <- fixed_values
    #-- output imputed values
    return(yimp)
}

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.