Fit Cox proportional hazards model on an time-to-event endpoint.
Arguments
- formula
An object of class
formula
that can be used withsurvival::coxph
. Must consistarm
and endpoint indata
. Covariates can be adjusted. Interactions betweenarm
and covariates are allowed informula
, butarm
must has a term of main effect, and only estimate of that main effect is tested.- placebo
Character. String indicating the placebo in
data$arm
.- data
Data frame. Usually it is a locked data set.
- alternative
a character string specifying the alternative hypothesis, must be one of
"greater"
or"less"
. No default value."greater"
means superiority of treatment over placebo is established by an hazard ratio greater than 1.- scale
character. The type of estimate in the output. Must be one of
"log hazard ratio"
or"hazard ratio"
. No default value.- ...
Subset conditions compatible with
dplyr::filter
.coxph
will be fitted on this subset only. This argument can be useful to create a subset of data for analysis when a trial consists of more than two arms. By default, it is not specified, all data will be used to fit the model. More than one condition can be specified in...
, e.g.,fitCoxph(formula, 'pbo', data, 'less', 'log hazard ratio', arm %in% c('pbo', 'low dose'), pfs > 0.5)
, which is equivalent to:fitCoxph(formula, 'pbo', data, 'less', 'log hazard ratio', arm %in% c('pbo', 'low dose') & pfs > 0.5)
.- tidy
logical.
FALSE
if more information are returned. DefaultTRUE
.
Value
a data frame with three columns:
arm
name of the treatment arm.
placebo
name of the placebo arm.
estimate
estimate of main effect of arm, depending on
scale
.p
one-sided p-value for log hazard ratio (treated vs placebo).
info
the number of events of the endpoint in the subset.
z
the z statistics of log hazard ratios.