yat  0.21pre
Public Member Functions | List of all members
theplu::yat::regression::Cox Class Reference

#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.
 
Coxoperator= (const Cox &other)
 
Coxoperator= (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
 

Detailed Description

Class handling univariable Cox regression.

The time-dependent hazard is modeled as $ \lambda(t|x) = \lambda_0(t) \exp (bx) $

Model parameters are inferred as described by Breslow (1975) and tied timepoints are handled as suggested by Efron (1975).

Constructor & Destructor Documentation

◆ Cox() [1/2]

theplu::yat::regression::Cox::Cox ( const Cox other)

Copy Constructor.

Create a copy of other and its data

◆ Cox() [2/2]

theplu::yat::regression::Cox::Cox ( Cox &&  other)

Move Constructor

Member Function Documentation

◆ add() [1/2]

void theplu::yat::regression::Cox::add ( double  x,
double  time,
bool  event 
)

Add one data point

Parameters
xvalue of the covariate variable
timetimepoint when event occured or sample was censored
eventtrue for non-censored sample

◆ add() [2/2]

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.

◆ b()

double theplu::yat::regression::Cox::b ( void  ) const

The time-dependent hazard is modeled as $ \lambda(t|x) = \lambda_0(t) \exp (bx) $

◆ clear()

void theplu::yat::regression::Cox::clear ( void  )

Remove all data.

◆ hazard_ratio()

double theplu::yat::regression::Cox::hazard_ratio ( void  ) const

The hazard ratio is defined as $ exp(b) $, in other words, the amount the hazard increases when the co-variate x increases with one unit.

◆ hazard_ratio_lower_CI()

double theplu::yat::regression::Cox::hazard_ratio_lower_CI ( double  alpha = 0.95) const
Returns
the lower bound of the alpha % confidence interval

◆ hazard_ratio_upper_CI()

double theplu::yat::regression::Cox::hazard_ratio_upper_CI ( double  alpha = 0.95) const
Returns
the upper bound of the alpha % confidence interval

◆ operator=()

Cox& theplu::yat::regression::Cox::operator= ( const Cox other)

Assignment operator

◆ train()

void theplu::yat::regression::Cox::train ( void  )

Infer model parameter b and related, hazard ratio and their confidence intervall.

◆ z()

double theplu::yat::regression::Cox::z ( void  ) const
Returns
b divided by standard error of b.

The documentation for this class was generated from the following file:

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14