Description Usage Arguments Details Value See Also Examples
Performs Cox regression on right-censored data using a multiple covariates.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | analyse_multivariate(
data,
time_status,
covariates,
strata = NULL,
covariate_name_dict = NULL,
covariate_label_dict = NULL,
reference_level_dict = NULL,
sort_frame_by = vars(HR)
)
analyze_multivariate(
data,
time_status,
covariates,
strata = NULL,
covariate_name_dict = NULL,
covariate_label_dict = NULL,
reference_level_dict = NULL,
sort_frame_by = vars(HR)
)
|
data |
A data frame containing the time/status information and, if used, the covariate. |
time_status |
A vector of length 2 giving the time and status fields.
It is recommended to use vars() and symbolic column names or code that is tidily-evaluated on |
covariates |
The covariates.
Pass symbolic columns names or code that is tidily-evaluated on |
strata |
Strata (optional). Same format as covariates. For each strata level (if multiple fields, unique combinations of levels) a separate baseline hazard is fit. |
covariate_name_dict |
A dictionary (named list or vector) of old->new covariate names |
covariate_label_dict |
A dictionary (named list or vector) of old->new covariate value level labels |
reference_level_dict |
For categorical variables, the Cox regression uses pseudo variables for each level
relative to a reference category, resulting in n-1 variables for n levels of a categorical covariate.
Hazard ratios will be relative to the reference level, which is defined as having hazard ratio 1.0.
Per default, the reference level is the first factor level.
You can specify a different level by passing a named vector: factor name -> value of reference level.
Note that this is independent of covariate_label_dict, i.e. specify the factor level as it is in |
sort_frame_by |
A vars() list of one or more symbolic column names.
The result contains a data frame of the cox regression results ( |
This method builds upon the survival
package and returns a comprehensive result object
for survival analysis containing the coxph results.
A format
/print
method is provided that prints the essential statistics.
An object of class "SurvivalAnalysisResult" and "SurvivalAnalysisMultivariateResult".
You can use this result as a black box for further functions in this package,
format
or
print
it,
retrieve information as a data frame via multivariate_as_data_frame
or
access individual pieces via pluck_multivariate_analysis
1 2 3 4 5 6 |
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
Overall:
n covariates
1776 rx, sex, age, obstruct, perfor, nodes, differ, extent
Likelihood ratio test p Wald test p Score (logrank) test p
<0.001 <0.001 <0.001
Hazard Ratios:
factor.id factor.name factor.value HR Lower_CI Upper_CI Inv_HR Inv_Lower_CI
rx:Lev+5FU rx Lev+5FU 0.64 0.54 0.75 1.57 1.33
sex sex <continuous> 0.91 0.8 1.04 1.09 0.96
rx:Lev rx Lev 0.93 0.8 1.09 1.08 0.92
age age <continuous> 1.0 1.0 1.01 1.0 0.99
nodes nodes <continuous> 1.08 1.07 1.1 0.92 0.91
differ differ <continuous> 1.16 1.01 1.33 0.86 0.75
perfor perfor <continuous> 1.16 0.81 1.66 0.86 0.6
obstruct obstruct <continuous> 1.22 1.04 1.44 0.82 0.69
extent extent <continuous> 1.6 1.36 1.87 0.63 0.53
Inv_Upper_CI p
1.86 <0.001
1.25 0.185
1.26 0.358
1.0 0.452
0.93 <0.001
0.99 0.036
1.23 0.412
0.96 0.016
0.74 <0.001
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.