R/get_naWorstOCF.R

#' Functions for Worst Observation Carried Forward
#' @description for Worst Observation Carried Forward
#' @param x Variables to be used for populates missing values with the subject's Worst-case nonmissing value.
#' @examples 
#' z <- c(11, NA, 13, NA, 15, NA)
#' get_naWorstOCF(z)
 
get_naWorstOCF<-function(x){WorstOCF<-x;
                            WorstOCF[is.na(x)]<-max(x[!is.na(x)])
                            return(WorstOCF)}
mssm-msf-2019/BiostatsALL documentation built on May 22, 2019, 12:16 p.m.