R/imputed.R

# ==============================================================================
# extract imputed values for mi.method class object
# ==============================================================================
setMethod( "imputed", signature( object = "mi.method" ),     
  function ( object, y ) {
    y[is.na( y )] <- object@random
    return( y )
  }
)


setMethod( "imputed", signature( object = "mi.categorical" ),     
  function ( object, y ) {
    #y.level <- levels(y)
    #y <- as.numeric(y)  
    y[is.na( y )] <- object@random
    return( y )
  }
)


setMethod( "imputed", signature( object = "mi.polr" ),     
  function ( object, y ) {
    #y.level <- levels(y)
    #y <- as.numeric(y)  
    y[is.na( y )] <- object@random
    return( y )
  }
)

Try the mi package in your browser

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

mi documentation built on May 2, 2019, 4:43 p.m.