#' Funció que donat un model Fine and Gray de riscos competitius retorna una taula amb:
#' les estimacions dels paràmetres,
#' l'error estàndar,
#' l'estadístic de contrast del paràmetre,
#' el valor p associat,
#' el HR, i
#' l'interval de confiança del HR
#'
#' @param model a competing risks model (an object of class "FGR").
#' @param level confidence level of the interval.
#' @return A data.table with estimates from model.
#' @export
summaryHR.FGR <- function(model, level = 0.95){
tab <- summary(model)$coef
x <- round(cbind("beta" = tab[, 1],
"SE" = tab[, 3],
"z-value" = tab[, 4],
"p-value" = tab[, 5],
"HR" = tab[, 2],
"LB" = exp(tab[, 1] - qnorm(1 - (1-level)/2)*tab[, 3]),
"UB" = exp(tab[, 1] + qnorm(1 - (1-level)/2)*tab[, 3])), 4)
colnames(x) <- c("Estimate", "SE", "z-value", "p-value", "HR", paste0("LB(", round(100*level, 0), "% CI)"), paste0("UB(", round(100*level, 0), "% CI)"))
rownames(x) <- rownames(tab)
return(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.