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

#include <yat/regression/MultiCox.h>

Public Member Functions

 MultiCox (void)
 Default Constructor.
 
 MultiCox (const MultiCox &other)
 Copy Constructor. More...
 
 MultiCox (MultiCox &&other)
 
 ~MultiCox (void)
 
MultiCoxoperator= (const MultiCox &other)
 
MultiCoxoperator= (MultiCox &&other)
 
void add (const utility::VectorBase &x, double time, bool event)
 add a sample More...
 
void add (const utility::MatrixBase &x, const utility::VectorBase &time, const std::vector< char > &event)
 Add n data points. More...
 
void clear (void)
 
void train (void)
 
double b (size_t i) const
 
double z (size_t i) const
 
double p (size_t i) const
 two-sided p-value for the null-hypothesis that $ b_i $ is zero.
 
double hazard_ratio (size_t i) const
 
double hazard_ratio_lower_CI (size_t, double alpha=0.95) const
 
double hazard_ratio_upper_CI (size_t, double alpha=0.95) const
 
const utility::MatrixBasecovariance (void) const
 

Detailed Description

Class handling multivariable Cox regression.

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

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

Constructor & Destructor Documentation

◆ MultiCox() [1/2]

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

Copy Constructor.

Create a copy of other and its data

◆ MultiCox() [2/2]

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

Move constructor

◆ ~MultiCox()

theplu::yat::regression::MultiCox::~MultiCox ( void  )

Destructor

Member Function Documentation

◆ add() [1/2]

void theplu::yat::regression::MultiCox::add ( const utility::VectorBase x,
double  time,
bool  event 
)

add a sample

Parameters
xvalue covariate vector for sample
timetimepoint when event occured for sample or sample was censored
eventtrue if sample was not censored

◆ add() [2/2]

void theplu::yat::regression::MultiCox::add ( const utility::MatrixBase x,
const utility::VectorBase time,
const std::vector< char > &  event 
)

Add n data points.

Each column in X corresponds to a data point. Equivalent to looping over the columns and vectors and calling single-sample version of add.

◆ b()

double theplu::yat::regression::MultiCox::b ( size_t  i) const

return ith element of the b-vector

◆ clear()

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

Remove all data

◆ covariance()

const utility::MatrixBase& theplu::yat::regression::MultiCox::covariance ( void  ) const
Returns
the covariance of the estimate b-vector; the diagonal contains the standard errors.

◆ hazard_ratio()

double theplu::yat::regression::MultiCox::hazard_ratio ( size_t  i) const

The hazard ratio associated with the ith variable.

◆ hazard_ratio_lower_CI()

double theplu::yat::regression::MultiCox::hazard_ratio_lower_CI ( size_t  ,
double  alpha = 0.95 
) const

Lower bound of confidence interval

◆ hazard_ratio_upper_CI()

double theplu::yat::regression::MultiCox::hazard_ratio_upper_CI ( size_t  ,
double  alpha = 0.95 
) const

Upper bound of confidence interval

◆ operator=() [1/2]

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

Assignment operator

◆ operator=() [2/2]

MultiCox& theplu::yat::regression::MultiCox::operator= ( MultiCox &&  other)

Move assignment

◆ train()

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

Find the parameters of the model

◆ z()

double theplu::yat::regression::MultiCox::z ( size_t  i) const
Returns
ith element of b divided by its standard error.

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