mlsurv {merlin} | R Documentation |
Fit proportional hazards survival models
Description
Fit proportional hazards survival models
Usage
mlsurv(
formula,
distribution,
df = NULL,
powers = NULL,
rcs = TRUE,
data,
from.null = NULL,
...
)
Arguments
formula |
A model formula, where the left-hand side is a Surv object. |
distribution |
A parametric distribution for the baseline hazard.
Possible values are |
df |
Represents the number of degrees of freedom used for the restricted cubic splines when flexibly modelling the baseline hazard.
Only required when |
powers |
A vector representing the degree of the fractional polynomials used to model the baseline hazard (with a maximum degree of 2).
Only required when |
rcs |
Use restricted cubic splines when flexibly modelling the baseline hazard? Defaults to |
data |
A data frame containing all variables required for fitting the model.
Can be a |
from.null |
A vector of starting values for the null model (used to get improved starting values). This is mostly useful when experiencing issues with default starting values or convergence issues. |
... |
Further arguments passed to merlin. |
Value
An object of class mlsurv
.
Examples
# Weibull model
library(survival)
data("pbc.merlin", package = "merlin")
fit <- mlsurv(
formula = Surv(stime, died) ~ trt,
distribution = "weibull",
data = pbc.merlin
)
summary(fit)
# Royston-Parmar model with 3 degrees of freedom
fit <- mlsurv(
formula = Surv(stime, died) ~ trt,
distribution = "rp",
df = 3,
data = pbc.merlin
)
summary(fit)
## Not run:
# Flexible parametric model on the log-hazard scale with fractional polynomials
fit <- mlsurv(
formula = Surv(stime, died) ~ trt,
distribution = "loghazard",
powers = c(0, 1),
rcs = FALSE,
data = pbc.merlin
)
summary(fit)
## End(Not run)