adminCens: Administrative censoring

Description Usage Arguments Details Examples

View source: R/splitFillCatFns.R

Description

If administratively censored fill-in censoring time and add flag.

Usage

1
adminCens(total.data)

Arguments

total.data

Details

Infected and non-infected datasets handled separately. Maximum discharge/death date for each sample separately i.e. administrative censoring times (not necessarily equal).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (total.data) 
{
    mix.disdteMax <- max(total.data$hes_disdte[total.data$infstatus == 
        0], na.rm = TRUE)
    inf.disdteMax <- max(total.data$hes_disdte[total.data$infstatus == 
        1], na.rm = TRUE)
    inhosp <- total.data$missingTime == 0 & total.data$hes_dismethdescription %in% 
        c("Not applicable patient still in hospital", "Not known")
    total.data$hes_disdte[total.data$infstatus == 0 & inhosp] <- mix.disdteMax
    total.data$hes_disdte[total.data$infstatus == 1 & inhosp] <- inf.disdteMax
    total.data$missingTime <- total.data$missingTime | inhosp
    total.data$missingType[inhosp] <- 0
    total.data$adm_diff_dis <- ifelse(total.data$hes_disdte - 
        total.data$hes_admdte == 0, 0.5, total.data$hes_disdte - 
        total.data$hes_admdte)
    total.data
  }

n8thangreen/HESmanip documentation built on March 21, 2020, 12:20 a.m.