yat  0.21pre
Cox.h
1 #ifndef theplu_yat_regression_cox
2 #define theplu_yat_regression_cox
3 
4 // $Id: Cox.h 4198 2022-08-19 06:26:14Z peter $
5 
6 /*
7  Copyright (C) 2022 Peter Johansson
8 
9  This file is part of the yat library, https://dev.thep.lu.se/yat
10 
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 3 of the
14  License, or (at your option) any later version.
15 
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with yat. If not, see <https://www.gnu.org/licenses/>.
23 */
24 
25 #include <memory>
26 #include <vector>
27 
28 namespace theplu {
29 namespace yat {
30  namespace utility {
31  class VectorBase;
32  }
33 namespace regression {
34 
35 
45  class Cox
46  {
47  public:
51  Cox(void);
52 
58  Cox(const Cox& other);
59 
63  Cox(Cox&& other);
64 
68  ~Cox(void);
69 
73  Cox& operator=(const Cox& other);
74 
78  Cox& operator=(Cox&& other);
79 
87  void add(double x, double time, bool event);
88 
95  void add(const utility::VectorBase& x,
96  const utility::VectorBase& time,
97  const std::vector<char>& event);
98 
102  void clear(void);
103 
108  void train(void);
109 
114  double b(void) const;
115 
119  double z(void) const;
120 
124  double p(void) const;
125 
131  double hazard_ratio(void) const;
132 
136  double hazard_ratio_lower_CI(double alpha=0.95) const;
137 
141  double hazard_ratio_upper_CI(double alpha=0.95) const;
142  private:
143  class Impl;
144  std::unique_ptr<Impl> pimpl_;
145  };
146 
147 }}}
148 
149 #endif
The Department of Theoretical Physics namespace as we define it.
double hazard_ratio_lower_CI(double alpha=0.95) const
Cox(void)
Default Constructor.
Cox & operator=(const Cox &other)
double hazard_ratio(void) const
double hazard_ratio_upper_CI(double alpha=0.95) const
This is the yat interface to GSL vector.
Definition: VectorBase.h:55
double p(void) const
two-sided p-value for the null-hypothesis that b is zero.
Definition: Cox.h:45
void add(double x, double time, bool event)

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