R/Impute.h.R

Defines functions Impute.h

Documented in Impute.h

Impute.h <-
function(x){
            h <- data.frame(x[, colnames(x)[grep("h", colnames(x))]])
            delta <- apply(h, 2, function(x) ifelse(is.na(x), 0, 1))
            h[is.na(h)] <- 0
            x[, colnames(h)] <- h
            return(data.frame(x, delta))
}

Try the CompetingRisk package in your browser

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

CompetingRisk documentation built on May 30, 2017, 2:54 a.m.