sahirbhatnagar / casebase
1
# S3 objects----
2
#' @param x Object of class \code{absRiskCB}, such as the output of
3
#'   \code{absoluteRisk} with single event.
4
#' @export
5
#' @rdname absoluteRisk
6
print.absRiskCB <- function(x, ...) {
7
  # Print without attributes for cleaner output
8 0
  print(x[, , drop = FALSE])
9
}
10

11
#################
12
# S4 objects----
13

14
#' @import methods
15
#' @importFrom stats binomial glm integrate pnorm quantile relevel runif time
16
#' @importFrom stats update terms
17
NULL
18

19
#' An S4 class to store the output of fitSmoothHazard
20
#'
21
#' This class inherits from \code{vglm-class}.
22
#'
23
#' @slot originalData Data.frame containing the original data (i.e. before
24
#'   case-base sampling). This is used by the \code{\link{absoluteRisk}}
25
#'   function.
26
#' @slot typeEvents Numeric factor which encodes the type of events being
27
#'   considered (including censoring).
28
#' @slot timeVar Character string giving the name of the time variable, as
29
#'   appearing in \code{originalData}
30
#' @slot eventVar Character string giving the name of the event variable, as
31
#'   appearing in \code{originalData}
32
#' @importClassesFrom VGAM vglm
33
CompRisk <- setClass("CompRisk",
34
  slots = c(
35
    originalData = "data.frame",
36
    typeEvents = "numeric",
37
    timeVar = "character",
38
    eventVar = "character"
39
  ),
40
  contains = "vglm",
41
  prototype = list(
42
    originalData = data.frame(),
43
    typeEvents = c(0, 1),
44
    timeVar = "time",
45
    eventVar = "event"
46
  )
47
)
48

49
#' @rdname CompRisk-class
50
#' @param ... Extra parameters
51
setGeneric("summary")
52
#' @export
53
#' @rdname CompRisk-class
54
#' @param object Object of class \code{CompRisk}
55
setMethod(
56
  "summary",
57
  c(object = "CompRisk"),
58 0
  function(object) callNextMethod()
59
)

Read our documentation on viewing source code .

Loading