glm.cox {adelie} | R Documentation |
Creates a Cox GLM family object.
Description
A GLM family object specifies the type of model fit, provides the appropriate response object and makes sure it is represented in the right form for the model family, and allows for optional parameters such as a weight vector.
Usage
glm.cox(
stop,
status,
start = -Inf,
strata = NULL,
weights = NULL,
tie_method = c("efron", "breslow")
)
Arguments
stop |
Stop time vector. |
status |
Binary status vector of same length as |
start |
Start time vector. Default is a vector of |
strata |
Observations can belong in strata, labeled 1,2, .... If |
weights |
Observation weights, with default |
tie_method |
The tie-breaking method - one of |
Value
Cox GLM object.
Author(s)
James Yang, Trevor Hastie, and Balasubramanian Narasimhan
Maintainer: Trevor Hastie hastie@stanford.edu
See Also
glm.gaussian
, glm.binomial
, glm.poisson
, glm.multinomial
, glm.multigaussian
, glm.cox
.
Examples
n <- 100
start <- sample.int(20, size = n, replace = TRUE)
stop <- start + 1 + sample.int(5, size = n, replace = TRUE)
status <- rbinom(n, 1, 0.5)
strata <- sample(c(1,2), n, replace = TRUE)
obj1 <- glm.cox(stop, status)
obj2 <- glm.cox(stop, status, start = start)
obj3 <- glm.cox(stop, status, start = start, strata = strata)