robin_surv | R Documentation |
Calculate log-rank test as well as hazard ratio estimates for survival data, optionally adjusted for covariates and a stratification factor.
robin_surv(
formula,
data,
treatment,
comparisons,
contrast = "hazardratio",
test = "logrank",
...
)
formula |
( |
data |
( |
treatment |
( |
comparisons |
( |
contrast |
( |
test |
( |
... |
Additional arguments passed to the survival analysis functions, in particular |
The user can optionally specify a list of comparisons between treatment levels to be performed. The list must have two elements:
Treatment level indices of the treatment group.
Treatment level indices of the control group.
So for example if you would like to compare level 3 with level 1, and also level 3 with level 2
(but not level 2 with level 1) then you can specify:
comparisons = list(c(3, 3), c(1, 2))
A surv_effect
object containing the results of the survival analysis.
surv_effect_methods for S3 methods.
# Adjusted for covariates meal.cal and age and adjusted for stratification by sex:
robin_surv(
formula = Surv(time, status) ~ meal.cal + age,
data = surv_data,
treatment = sex ~ strata
)
# Adjusted for stratification by strata but not for covariates:
robin_surv(
formula = Surv(time, status) ~ 1,
data = surv_data,
treatment = sex ~ strata
)
# Unadjusted for covariates and stratification:
robin_surv(
formula = Surv(time, status) ~ 1,
data = surv_data,
treatment = sex ~ 1
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.