Learn R Programming

h2o (version 2.8.4.4)

h2o.coxph: H2O: Cox Proportional Hazards Models

Description

Fit a Cox Proportional Hazards Model.

Usage

h2o.coxph(x, y, data, key = "", weights = NULL, offset = NULL,
          ties = c("efron", "breslow"), init = 0,
          control = h2o.coxph.control(...), ...)

h2o.coxph.control(lre = 9, iter.max = 20, ...)

# H2OCoxPHModel summary functions ## S3 method for class 'H2OCoxPHModel': summary(object, conf.int = 0.95, scale = 1, ...) ## S3 method for class 'H2OCoxPHModel': survfit(formula, newdata, conf.int = 0.95, conf.type = c("log", "log-log", "plain", "none"), ...)

# H2OCoxPHModel extractor functions ## S3 method for class 'H2OCoxPHModel': extractAIC(fit, scale, k = 2, ...) ## S3 method for class 'H2OCoxPHModel': logLik(object, ...) ## S3 method for class 'H2OCoxPHModel': vcov(object, ...)

Arguments

x
A character vector containing the column names of the predictors in the model.
y
A character vector comprised of two or three elements representing "(stop, event)" or "(stop, event)" respectively.
data
An H2OParsedData object containing the variables in the model.
key
An optional unique hex key assigned to the resulting model. If none is given, a key will automatically be generated.
weights
An optional character string representing the case weights in the model.
offset
An optional character vector representing the offset terms in the model.
ties
A character string denoting which approximation method for handling ties should be used in the partial likelihood; one of either "efron" or "breslow".
init
A numeric vector containing the finite starting values for the model coefficients.
control
The model fitting control arguments specified by h2o.coxph.control
lre
A positive number for the log-relative error (LRE) of subsequent log partial likelihood calculations to determine convergence in h2o.coxph.
iter.max
A positive integer denoting the maximum number of iterations to allow for convergence in h2o.coxph.
object, formula, fit
An object of class H2OCoxPHModel.
newdata
An optional H2OParsedData object containing a new data set.
conf.int
An optional number that specifies the confidence interval level.
conf.type
An optional string that specifies the confidence interval type.
scale
An optional number that specifies the scale parameter of the model.
k
An optional number specifying the weight for the equivalent degrees of freedoms in the AIC calculation.
...
Additional arguments.

Value

  • An object of class H2OCoxPHModel.

References

Andersen, P. and Gill, R. (1982). Cox's regression model for counting processes, a large sample study. Annals of Statistics 10, 1100-1120.

Harrell, Jr. F.E., Regression Modeling Strategies: With Applications to Linear Models, Logistic Regression, and Survival Analysis. Springer-Verlag, 2001.

Therneau, T., Grambsch, P., Modeling Survival Data: Extending the Cox Model. Springer-Verlag, 2000.

See Also

coxph, summary.coxph, survfit.coxph, extractAIC, logLik, vcov

Examples

Run this code
library(h2o)
localH2O <- h2o.init()

# Use pbc data set from the survival package
pbc.hex <- as.h2o(localH2O, pbc, key = "pbc.hex")
pbc.hex$statusOf2  <- pbc.hex$status == 2
pbc.hex$logBili    <- log(pbc.hex$bili)
pbc.hex$logProtime <- log(pbc.hex$protime)
pbc.hex$logAlbumin <- log(pbc.hex$albumin)
pbcmodel <- h2o.coxph(x = c("age", "edema", "logBili", "logProtime", "logAlbumin"),
                      y = c("time", "statusOf2"), data = pbc.hex)
summary(pbcmodel)
pbcsurv <- survfit(pbcmodel)
summary(pbcsurv)
plot(pbcsurv)

Run the code above in your browser using DataLab