Fit Cox proportional hazards model on an time-to-event endpoint.
Refer to this vignette for more information and examples.
fitCoxph(formula, placebo, data, alternative, scale, ..., tidy = TRUE)a data frame with three columns:
armname of the treatment arm.
placeboname of the placebo arm.
estimateestimate of main effect of arm, depending on scale.
pone-sided p-value for log hazard ratio (treated vs placebo).
infothe number of events of the endpoint in the subset.
zthe z statistics of log hazard ratios.
An object of class formula that can be used with
survival::coxph. The data frame data must consist a column
arm and a column of the endpoint specified in formula.
Covariates can be adjusted. Interactions between arm and covariates are
allowed in formula, but arm must has a term of main effect,
and only estimate of that main effect is tested.
Character. String indicating the placebo in data$arm.
Data frame. Usually it is a data snapshot locked at a milestone.
a character string specifying the alternative hypothesis,
must be one of "greater" or "less", i.e., one-sided test is
enforced. No default value.
"greater" means superiority of treatment over placebo is established
by an hazard ratio greater than 1.
character. The type of estimate in the output. Must be one
of "log hazard ratio" or "hazard ratio". No default value.
(optional) 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'), x > 0.5),
which is equivalent to:
fitCoxph(formula, 'pbo', data, 'less', 'log hazard ratio', arm %in% c('pbo', 'low dose') & x > 0.5).
Note that if more than one treatment arm are present in the data after
applying filter in ..., models are fitted and tested for placebo verse
each of the treatment arms.
logical. FALSE if more information are returned.
Default: TRUE.