Description Usage Arguments See Also Examples
One of several output formats. This format is used in the Journal of Pediatric Infectious Diseases Society (JPIDS) paper.
1 | table3.HR(res, hrtype)
|
res |
|
hrtype |
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 | ##---- 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 (res, hrtype)
{
if (hrtype == "timedeptsubdistn") {
colNames <- c("Organism", "Disch Time-adjusted", "Disch Fully adjusted",
"Death Time-adjusted", "Death Fully adjusted")
}
else if (hrtype == "naive") {
colNames <- c("Organism", "Disch", "Death", "Both")
}
else if (hrtype == "timedeptcausespec") {
colNames <- c("Organism", "Disch Time-adjusted", "Disch Fully adjusted",
"Death Time-adjusted", "Death Fully adjusted", "Both Time-adjusted",
"Both Fully adjusted")
}
else {
stop("type unidentified")
}
res.new <- data.frame(matrix(ncol = length(colNames)))
colnames(res.new) <- colNames
for (name in unique(res$organism)) {
whichrows <- which(res$organism == name & res$method ==
hrtype)
rowTotal <- NULL
for (j in 1:length(whichrows)) {
temp <- paste(res[whichrows[j], "exp(beta)"], " (",
res[whichrows[j], "Lower CI"], ", ", res[whichrows[j],
"Upper CI"], ")", sep = "")
rowTotal <- c(rowTotal, temp)
}
res.new <- rbind(res.new, c(name, rowTotal))
}
res.new <- res.new[!is.na(res.new[, 1]), ]
res.new
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.