Description Usage Arguments Value Examples
Fit proportional hazards survival models
1 2 3 4 5 6 7 8 9 10 |
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. |
An object of class mlsurv
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.