Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

print.npcure

Print Method for Objects of Class 'npcure'


Description

This function implements a print method for 'npcure' objects.

Usage

## S3 method for class 'npcure'
print(x, how, head = FALSE, ...)

Arguments

x

An object of class 'npcure'.

how

A character string with values "wide" or "long". If missing, the function itself chooses a convenient default.

head

A logical value that controls whether the function's output must be abbreviated (TRUE) or not (FALSE, the default).

...

Further optional arguments. Excepting for n, which controls how many lines are printed when head = TRUE, these are the arguments for the default method (i.e., print.default) of the print generic function.

Value

A formatted output.

Author(s)

Ignacio López-de-Ullibarri [aut, cre], Ana López-Cheda [aut], Maria Amalia Jácome [aut]

See Also

Examples

## Some artificial data
set.seed(123)
n <- 50
x <- runif(n, -2, 2) ## Covariate values
y <- rweibull(n, shape = .5*(x + 4)) ## True lifetimes
c <- rexp(n) ## Censoring values
p <- exp(2*x)/(1 + exp(2*x)) ## Probability of being susceptible
u <- runif(n)
t <- ifelse(u < p, pmin(y, c), c) ## Observed times
d <- ifelse(u < p, ifelse(y < c, 1, 0), 0) ## Uncensoring indicator
data <- data.frame(x = x, t = t, d = d)

## Calling 'print()' with an object of class 'npcure' created by
## 'latency()' 
S1 <- latency(x, t, d, data, x0 = c(0, .5), h = c(1, 1.5))

## In this case (latency estimation with local bandwidths and without
## confidence bands), the 'wide' format is used by default
S1
print(S1, how = "wide")
print(S1, how = "long")

## How to control the number of significant digits of the output, and
## how to abbreviate the output 
print(S1, digits = 5, head = TRUE, n = 4)

## Calling 'print()' with a 'npcure' object created by 'probcure()'
q1 <- probcure(x, t, d, data, x0 = c(0, .5), h = c(.5, 1, 1.5), local =
FALSE, conflevel = .95)

## Only the 'long' format is available when confidence bands are
## computed
q1
print(q1, how = "long")
print(q1, how = "wide")

npcure

Nonparametric Estimation in Mixture Cure Models

v0.1-5
GPL (>= 2)
Authors
Ignacio López-de-Ullibarri [aut, cre], Ana López-Cheda [aut], Maria Amalia Jácome [aut]
Initial release
2020-02-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.