Description Usage Arguments Value See Also Examples
Batch calculate all the cumulative hazards, transition probabilites and length of stay for each of the organism groups in turn
1 | byGroupLOS(survData.list, type, standerr = FALSE)
|
survData.list |
|
type |
Model type: cause-specific "", subdistribution with discharge alive as event of interest "alive" or subdistribution with in-hospital death as the event of interest "dead". |
standerr |
Should the standard error be calculated. This may take some minutes. |
Returns list of lists. Below initial sample stratification:
mvna.data |
Output from |
clos.data |
Excess length of stay output |
se |
Bootstrap standard error estimate |
etm.data |
Output from |
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 29 30 31 32 33 34 35 36 37 38 39 40 | require(mvna)
require(etm)
data(survDataByGender)
foo <- byGroupLOS(survDataByGender,"")
foo$Male$clos.data
## The function is currently defined as
function (survData.list, type, standerr = FALSE)
{
startTime <- Sys.time()
namesGroup <- names(survData.list)
progressbar <- txtProgressBar(min = 0, max = length(namesGroup),
style = 3)
counter = 0
tra <- matrix(FALSE, 3, 3, dimnames = list(as.character(0:2),
as.character(0:2)))
tra[1, 2:3] <- TRUE
tra[2, 3] <- TRUE
results <- list()
for (i in namesGroup) {
counter = counter + 1
setTxtProgressBar(progressbar, counter)
if (i == "") {
stop("no group name")
}
if (nrow(survData.list[[i]]) == 0) {
results[[i]] <- list(NA, NA, NA)
}
else {
results[[i]] <- listLOS(survData.list[[i]], tra,
type, standerr)
}
}
close(progressbar)
cat(Sys.time() - startTime)
results
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.