yat
0.20.3pre
|
#include <yat/regression/Cox.h>
Public Member Functions | |
Cox (void) | |
Default Constructor. | |
Cox (const Cox &other) | |
Copy Constructor. More... | |
Cox (Cox &&other) | |
~Cox (void) | |
Destructor. | |
Cox & | operator= (const Cox &other) |
Cox & | operator= (Cox &&other) |
Move assignment. | |
void | add (double x, double time, bool event) |
void | add (const utility::VectorBase &x, const utility::VectorBase &time, const std::vector< char > &event) |
Add n data points. More... | |
void | clear (void) |
void | train (void) |
double | b (void) const |
double | z (void) const |
double | p (void) const |
two-sided p-value for the null-hypothesis that b is zero. | |
double | hazard_ratio (void) const |
double | hazard_ratio_lower_CI (double alpha=0.95) const |
double | hazard_ratio_upper_CI (double alpha=0.95) const |
Class handling univariable Cox regression.
The time-dependent hazard is modeled as
Model parameters are inferred as described by Breslow (1975) and tied timepoints are handled as suggested by Efron (1975).
theplu::yat::regression::Cox::Cox | ( | const Cox & | other | ) |
Copy Constructor.
Create a copy of other
and its data
theplu::yat::regression::Cox::Cox | ( | Cox && | other | ) |
Move Constructor
void theplu::yat::regression::Cox::add | ( | double | x, |
double | time, | ||
bool | event | ||
) |
Add one data point
x | value of the covariate variable |
time | timepoint when event occured or sample was censored |
event | true for non-censored sample |
void theplu::yat::regression::Cox::add | ( | const utility::VectorBase & | x, |
const utility::VectorBase & | time, | ||
const std::vector< char > & | event | ||
) |
Add n data points.
Equivalent to looping over the vectors and calling single-sample version of add.
double theplu::yat::regression::Cox::b | ( | void | ) | const |
The time-dependent hazard is modeled as
void theplu::yat::regression::Cox::clear | ( | void | ) |
Remove all data.
double theplu::yat::regression::Cox::hazard_ratio | ( | void | ) | const |
The hazard ratio is defined as , in other words, the amount the hazard increases when the co-variate x increases with one unit.
double theplu::yat::regression::Cox::hazard_ratio_lower_CI | ( | double | alpha = 0.95 | ) | const |
double theplu::yat::regression::Cox::hazard_ratio_upper_CI | ( | double | alpha = 0.95 | ) | const |
void theplu::yat::regression::Cox::train | ( | void | ) |
Infer model parameter b and related, hazard ratio and their confidence intervall.
double theplu::yat::regression::Cox::z | ( | void | ) | const |