# =========================================================
# Print class emmfrailty
# =========================================================
#' @export
#' @method print emmfrailty
#' @keywords internal
print.emmfrailty <- function(object, ...) {
if (!is.null(object$fail)) {
cat("Fitting failed.", object$fail, "\n")
return()
}
digits = max(1L, getOption("digits") - 3L)
signif.stars = FALSE
savedig <- options(digits = digits)
on.exit(options(savedig))
J <- object$neventtype
est <- object$omega
beta.coef <- object$beta.coefficients
se <- sqrt(diag(object$var))
beta.se <- lapply(1:J, function(i) sqrt(object$betavar[[i]]))
if (is.null(est) | is.null(se))
stop("Input is not valid")
K = J * (J - 1)/2
com = combn(J, 2)
tmp <- list()
for (i in 1:J) {
if (!is.null(object$betavar[[i]])) {
tmp[[i]] <- cbind(beta.coef[[i]], exp(beta.coef[[i]]), beta.se[[i]],
beta.coef[[i]]/beta.se[[i]], pchisq((beta.coef[[i]]/beta.se[[i]])^2,
1, lower.tail = FALSE))
dimnames(tmp[[i]]) <- list(names(beta.coef[[i]]), c("coef", "exp(coef)",
"se(coef)", "z", "p"))
}
}
cat("\n")
if (is.null(object$copula))
cat("#### Semiparametric Independent Estimation ####") else {
if (object$two_stage)
cat("#### Semiparametric Two-stage Pairwise Estimation ####") else cat("#### Semiparametric Pairwise Estimation ####")
}
cat("\n\n")
cat("Marginal Parameters")
for (i in 1:J) {
cat("\n")
cat("Event: ", object$varnames$eventnames[i])
cat("\n")
printCoefmat(tmp[[i]], digits = digits, P.values = TRUE, has.Pvalue = TRUE,
signif.stars = signif.stars, ...)
cat("\n")
cat("Variance of random effect ", object$margins[i], ": ", object$sig2[i],
" ", "(", sqrt(object$sig2var[i]), ")", sep = "")
cat(" n=", object$n)
if (!is.null(object$nevent[i]))
cat(", number of events", object$varnames$eventnames[i], "=", object$nevent[i],
"\n") else cat("\n")
}
if (!is.null(object$copula)) {
cat("\n")
cat("\n")
cat("Depedente Parameter: ", object$copula, sep = "", "\n")
for (i in 1:K) {
cat("Event", com[1, i], "&", "Event", com[2, i], "- ")
cat("Copula parameter ", ": ", object$rho[i], " ", "(", sqrt(object$rhovar[i]),
")", sep = "")
cat("\n")
}
invisible(object)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.