Survival Analysis function used to compute the Kaplan-Meier Estimate of survival probalities for a sample of failure times. This is an OriginPro only function.
int ocmath_kaplan_meier_surviv_fn( const double * pTime, uint nTime, const double * pCensor, uint nCensor, const double * pCensored, uint nCensoredVal, const double dConLevel, SAEstim * psSurvivEstim, uint nSizeSAEstm, SAQuantEst * psSAQuantEstim, uint nSizeQuanEstm, SASummary * stSASumStats, SAMeanEst * pSAMeanEst = NULL )
Returns STATS_NO_ERROR on successful exit or an STATS error code on failure.
EX1
void ocmath_kaplan_meier_surviv_fn_ex1() { vector vTime = { 107,90,169,50,954,972,6,111,70,90,930,52,50,414,111,482,104,29,983,93,133,468,65,846 }; vector pCensor = { 0,1,0,1,0,0,1,1,0,2,0,0,0,2,0,1,0,1,1,0,2,0,0,1 }; vector pCensored = {0, 2}; int nCensoredVal = pCensored.GetSize(); double dConLevel = 0.90; SAEstim psSurvivEstim[24]; SAQuantEst psSAQuantEstim[3]; SASummary stSASumStats; SAMeanEst pSAMeanEst; int nRet = ocmath_kaplan_meier_surviv_fn(vTime, vTime.GetSize(), pCensor, pCensor.GetSize(), pCensored, nCensoredVal, dConLevel, psSurvivEstim, 24, psSAQuantEstim, 3, &stSASumStats); }
origin.h