Fit Cox proportional hazards model on an time-to-event endpoint.
Refer to this vignette for more information and examples.
Arguments
- formula
An object of class
formulathat can be used withsurvival::coxph. The data framedatamust consist a columnarmand a column of the endpoint specified informula. Covariates can be adjusted. Interactions betweenarmand covariates are allowed informula, butarmmust 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 data snapshot locked at a milestone.
- alternative
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.- scale
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.coxphwill 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.- tidy
logical.
FALSEif more information are returned. Default:TRUE.
Value
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.
