Description Usage Arguments Examples
Create a simpler survival analysis format array; basically a subset of the total.data columns with the dates removed so all time origins are equal.
1 | getSurvData(total.data)
|
total.data |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ##---- 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)
{
survData <- within(total.data, {
time <- as.numeric(adm_diff_dis)
event <- hes_dischargeddeadoralive == "Death"
age <- hes_ageatstartofepisode
gender <- droplevels(hes_sexdescription)
spectime <- as.numeric(adm_diff_specdate)
agegr <- cut(age, breaks = c(0, 2, 5, 10, 18, 40, 60,
100, 10000))
rm(lab_opieid, hes_ID, lab_Specimendate, hes_admdte,
hes_disdte, adm_diff_specdate, dis_diff_specdate,
hes_dismethdescription, adm_diff_dis, hes_sexdescription,
hes_ageatstartofepisode, hes_dischargeddeadoralive,
lab_organismname, lab_group, Gram)
})
survData$age[survData$age > 1000] <- 0
survData$agegr <- factor(survData$agegr, c("(100,1e+04]",
"(0,2]", "(2,5]", "(5,10]", "(10,18]", "(18,40]", "(40,60]",
"(60,100]"))
survData <- subdistn(survData)
survData
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.