Description Usage Arguments See Also Examples
View source: R/bootstrapping_SE.R
A data.table version of boot_clos() for faster run-time.
1 | boot.clos.dtable(data, state.names, tra, cens.name, s = 0, nboot)
|
data |
class(data.table) |
state.names |
|
tra |
|
cens.name |
|
s |
|
nboot |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ##---- 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 (data, state.names, tra, cens.name, s = 0, nboot)
{
res <- double(nboot)
setkey(data, "id")
for (i in seq_len(nboot)) {
index <- sample(unique(data[, id]), replace = TRUE)
dboot <- data[J(index)]
tr.prob <- etm(dboot, state.names, tra, cens.name, s,
cova = FALSE)
res[i] <- etm::clos(tr.prob)$e.phi
}
res
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.