statcpp
C++17 Header-Only Statistics Library
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
survival.hpp File Reference

Survival analysis functions. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <limits>
#include <numeric>
#include <stdexcept>
#include <vector>
#include "statcpp/continuous_distributions.hpp"
Include dependency graph for survival.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  statcpp::kaplan_meier_result
 Kaplan-Meier estimation result. More...
 
struct  statcpp::logrank_result
 Log-rank test result. More...
 
struct  statcpp::hazard_rate_result
 Hazard rate result. More...
 

Namespaces

namespace  statcpp
 

Functions

kaplan_meier_result statcpp::kaplan_meier (const std::vector< double > &times, const std::vector< bool > &events)
 Estimate Kaplan-Meier survival curve.
 
logrank_result statcpp::logrank_test (const std::vector< double > &times1, const std::vector< bool > &events1, const std::vector< double > &times2, const std::vector< bool > &events2)
 Log-rank test (comparison of two survival curves)
 
double statcpp::median_survival_time (const kaplan_meier_result &km)
 Calculate median survival time.
 
hazard_rate_result statcpp::nelson_aalen (const std::vector< double > &times, const std::vector< bool > &events)
 Nelson-Aalen cumulative hazard estimation.
 

Detailed Description

Survival analysis functions.

Provides functions for survival analysis including Kaplan-Meier estimation, Log-rank test, and Nelson-Aalen estimation.

Definition in file survival.hpp.