R/print.cpf.R

Defines functions print.cpf

Documented in print.cpf

print.cpf <- function(x, ...) {
    if (!inherits(x, "cpf"))
        stop("'x' must be of class 'cpf'")
    cat("Call: "); dput(x$call); cat("\n")
    cat("Number of observations: ",
        sum(x$n.risk[c(1, x$size.strata[-length(x$size.strata)] + 1)]),
        "\n\n")
    if (!is.null(x$X)) {
        cat("Covariate: ", colnames(x$X), "\n")
        cat("\tlevels: ", x$X[,], "\n\n")
    }
    Cause <- c(x$failcode, "other", "censored")
    n.event <- c(sum(x$n.event[, 1]), sum(x$n.event[, 2]), sum(x$n.lost))
    print(data.frame(Cause, n.event), row.names = FALSE)
    invisible()
}

Try the Cprob package in your browser

Any scripts or data that you put into this service are public.

Cprob documentation built on May 23, 2018, 1:05 a.m.